RandomRambo Posted May 19 Share Posted May 19 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
DeadMau57 Posted May 20 Share Posted May 20 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
DiSaMe Posted May 20 Share Posted May 20 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now