SA-MP Forums Archive
Checking the player Vehicle. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checking the player Vehicle. (/showthread.php?tid=270917)



Checking the player Vehicle. - ricardo178 - 22.07.2011

Hello guys...
I am looking and making failed trys for about 1 hour....
It's so simple, and i've done it before, but now, it isn't working...

I've defined some vehicles...

Vehicle1 = AddStaticVehicle(bla bla bla);
Vehicle2 = AddStaticVehicle(bla bla bla);
Vehicle3 = AddStaticVehicle(bla bla bla);
Vehicle4 = AddStaticVehicle(bla bla bla);
Vehicle5 = AddStaticVehicle(bla bla bla);

And now, i want that, when the player enter a vehicle, if it is one of this ones, it will send a client message and stop the vehicle engine...
I tryed to put the code under OnPlayerKeyStateChange and OnPlayerEnterVehicle, but they don't show up any error, and don't work in-game...
When i put under OnPlayerKeyStateChange, i enter vehicle, engine is off, but it only show me the message when i click the acelarate/brake/right/left key, and spam it each time i click it...
More, when i use the cmd to start engine, it stop it again automaticly...

Any help is apreciated, Thank you.


Re: Checking the player Vehicle. - Lorenc_ - 22.07.2011

Do you know what 'OnPlayerKeyStateChange' is for? Use OnPlayerStateChange


Re: Checking the player Vehicle. - ricardo178 - 22.07.2011

My great fail xD.
Thank you very much... All works well now.