statechange
#2

In case the player exits the vehicle, vehicleid will be 0.
His oldstate may still hold he was the driver, but newstate is onfoot, and using GetPlayerVehicleID will return 0.
You're still checking if he's inside a mower vehicle while he's already onfoot (your first "if(oldstate ...." statement).
Note: the comment after that line is not correct as well.

You could use OnPlayerExitVehicle to store the vehicleid in the player's account (create an array like LastVehicle[MAX_PLAYERS] for example, like your MowerJob array) and use that value inside OnPlayerStateChange.
Reply


Messages In This Thread
statechange - by Markus1337 - 17.02.2014, 06:57
Re: statechange - by PowerPC603 - 17.02.2014, 07:49
Re: statechange - by Vanter - 17.02.2014, 09:41

Forum Jump:


Users browsing this thread: 1 Guest(s)