[Help] Native for making NPC see entity as an object?

Hey guys.

So im working on a prop placement menu, Link here:

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 :grin:

I will dont worry :smiley: :smiley:

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! :smiley:

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

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 :confused: Brig check discord, Ill send you the code maybe if you see it you may spot a way to do it

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?

Ah, that makes sense.