Hey guys.
So im working on a prop placement menu, Link here:
[https://gyazo.com/6885e7ac8ba3abfd3fe251e2eaf8a64f]
So im pretty new to coding, And all i ever wanted was something simple to place items like you do with menus etc.
Right now it’s early days, But it’s there and working. I plan on making a full menu with many props!
Make a race circuit?
Place cones in an area of stress?
Place a ramp for fun?
Yes this will be set via either job id or users.permission_level.
Please comment below some suggestions! Again this is my first attempt at a script …
And i need a way for NPC to see these props/Entitys as an object. I was told there is a way to make them see it as an object and avoid it.
Is this a native? Or is this a bit of code to do checks?
Any help would be appriciated! <3
1 Like
I haven’t tested any of this, and I am not sure if any of it will work, but you could try the following:
Set the drive style with a flag to avoid objects. You can read more here: http://gtaforums.com/topic/822314-guide-driving-styles/
and/or there is a native to drive around objects: http://runtime.fivem.net/doc/reference.html#_0x1509C089ADC208BF
1 Like
Thank you so much, I will give it a try soon!
If you do get anything working, let me know, because I’m curious about it, too
Something like this to
void SET_PED_STEERS_AROUND_OBJECTS(Ped ped, BOOL toggle);
this?
SetPedSteersAroundObjects(obj1, true) ?
That might be the wrong format still learning
SetPedSteersAroundObjects(ped, toggle)
You can goto your FiveM install and find the file 'natives_…" in citizen/scripting/lua to find all the native formats for Lua.
Can you explain the Ped and BOOL? Sorry haha! BOOL is true or false right?
You have to call this native for every Ped near to the object. This is what the first param is for. The second is just a bool, to toggle. If true
, the Ped Steers around, if false
, it doesn’t!
You can not use this native, because you would have to call it on every npc around the Object. Unfortunately there is, afaik, no way to get all the nearby peds.
There has to be a solution to this.
At the moment i just made the object freeze as a solid item so they smash into it.
Is there anything else i could use or do to get this to work? Even if its a weird way around it?
I am searching for a solution rn, I will answer when I find one
Thank you!
Iknow when a ped or a car is front of a NPC they recognise it, But im guessing there is no easy way to achieve this
hallux
July 4, 2017, 7:33pm
13
What if you used any of the following…
BOOL IS_ANY_PED_NEAR_POINT(float x, float y, float z, float radius)
BOOL IS_ANY_VEHICLE_NEAR_POINT(float x, float y, float z, float radius)
Would that be something that would work? You’d have to get the x, y, z of the object though?
Hmmmmmm…
i think my placement tracks the coords… Im not 100% thou
Those would just return true or false if something was near it. It wouldnt actually return what it was.
Damn Brig check discord, Ill send you the code maybe if you see it you may spot a way to do it
hallux
July 4, 2017, 7:43pm
17
Yes but if it returns true, could he then use the SetPedSteersAroundObjects?
Not on discord right now, and I am not sure.
@tecster No, because it only returns true or false. It doesn’t return the ped ID or anthing.
So in other words that would work with other natives involved blahblah to track the peds?