Hi, an interesting script that I could not find on the forum and decided to write it myself. ( Nearly ). Through these functions, you can interact with players, peds, cars, objects and more. If someone knows how to make peda walk when cursor is on, inform.
UPD: For some reason, tabulation is broken on the git hub, strange. [CODE] [SHOWCASE]
Too lazy to add it fxmanifest, I think who needs it, will write it himself.
The script determines the raycast (Tracer aka a beam that is directed to an object, ped, or car.) Through this thread, you can do mouse interaction (SetNuiFocus) with objects. That is, you can in fact not use the menu in many cases of interaction with people, objects, players, peds
or this example:
It’s just that I don’t have SetNuiFocus, but the usual GTA cursor. If you do it through SetNuiFocus, and correctly configure it through SetNuiFocusKeepInput (), you get quite an interesting interaction with the outside world. Here’s an example:
I found a couple more examples of how this can be used
The main thing is fantasy. A very convenient thing, I have wanted to write it for a long time, but did not find a topic on the forum that would help me. And I decided to make a release so that the developers would make quality content
I’ll go ahead and risk it, I think if you actually stop using the default systems for the scripts, like get player position and calculate to see how far it is to a point and instead use this raycast system you could simply make a MUCH more efficient and even populated environment, you wouldn’t have 10x spots where you calculate dist to see if player in radius but raycast object, if in front of object allow press key to do stuff.
Should actually be better if correctly implemented.
Nice to see that my server inspires people to do stuff!
One reminder: you don’t need to raycast every frame, just separate onscreen draw code and raycast code. Raycasting every 100-200 ms works fine for most cases.
Well, how is your server. All the same, Umbrella was the first to make the idea, and you have already taken this idea from them :). The only one in the CIS who did this was Vinipux228 aka Syoma. And so, thanks for the advice. I will consider.
I was just too lazy to write a script, and literally in one minute I threw a stream. I just showed people how to do it, that’s all. This is not a standalone script, just an example.
Been working on getting something like this to work for a while, will check to see if yours is an improvement on mine as I struggled to get the cursor and raycast to meet one another in the 3D space.
First, it was not me who did it.
Most likely, he takes the position from the raycast, and verifies it from the config, and which is closer - opens. I just don’t remember if there is a function that checks what the label is and so on.
The original script was made by Stuyk, for another mod. Even though it’s for another mod, I think you should still give credit. Correct me if I’m wrong mods