SA-MP Forums Archive
if x do nothing - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: if x do nothing (/showthread.php?tid=627644)



if x do nothing - AndreiWow - 30.01.2017

Question, how can I make if something is true it will do nothing?

I want to make a vehicle lock and I want that if he tries to enter a locked vehicle it will do nothing? Do ClearAnimations work, like to stop him from entering the vehicle.


Re: if x do nothing - kelvinis - 30.01.2017

Show code


Re: if x do nothing - Eoussama - 30.01.2017

Quote:
Originally Posted by AndreiWow
Посмотреть сообщение
Question, how can I make if something is true it will do nothing?

I want to make a vehicle lock and I want that if he tries to enter a locked vehicle it will do nothing? Do ClearAnimations work, like to stop him from entering the vehicle.
Clearing one's animation is enough


Re: if x do nothing - AndreiWow - 30.01.2017

Quote:
Originally Posted by kelvinis
Посмотреть сообщение
Show code
I didn't make it yet, I just asked if I can use clearplayeranimations to stop a player from entering a vehicle, I want to make a lock system and I am not sure how to stop the player from entering the vehicle if it is locked, what method to use not how to script it.


Re: if x do nothing - princejeet1510 - 30.01.2017

Add like on player enter vehicle check if it's locked something similar..
PS:you can use playerstate method too and after your code to remove player use
PHP код:
RemovePlayerFromVehicle(playerid); 



Re: if x do nothing - renatog - 30.01.2017

Use this callback: https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle
If the vehicleid is locked, use https://sampwiki.blast.hk/wiki/ClearAnimations


Re: if x do nothing - Beckett - 30.01.2017

Why not use SetVehicleParamsEx and actually lock the vehicle's door?


Re: if x do nothing - AndreiWow - 30.01.2017

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
Why not use SetVehicleParamsEx and actually lock the vehicle's door?
Oh damn... totally forgot about that, thanks alot.