Jump to content

Ped freeze


Recommended Posts

Hi guys.

Is it possible to freeze ped that he can't attack (not only can't move)?
I used setPedFrozen(ped, true),he can't move but he can attack. Is it possible to use toggleAllControls to the ped or there is another way to do it?

Link to comment

Greetings, RandomRambo. 

Yes, it is possible to use 'toggleAllControls'. You could also disable the fire control only, which will prevent the PED from attacking.

toggleControl ( ped, "fire", false )

Also, the function 'setPedFrozen' is deprecated, use setElementFrozen instead.

 

Link to comment

toggleAllControls won't work on anything but players. It doesn't even make sense for anything but players, because it disables specifically inputs done manually - setControlState (or setPedControlState on localPlayer) even works if the controls are disabled for local player.

The proper solution is not making them attack in the first place. It is the script that sets the control states, so it should set them to false and keep them that way.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...