SA-MP Forums Archive
Save a vehicule position - 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: Save a vehicule position (/showthread.php?tid=416479)



Save a vehicule position - Vlaoff - 17.02.2013

Hello,

I'd like to have vehicules position always up to date in my database (mysql), for now i'm updating it when a player exits the car, but if he deco without exiting, or if he falls of his bike, the last position is not saved ...
With Callback could uptade the position frequently without overloading the server ?

Thanks,

(sorry for my bad english )


AW: Save a vehicule position - Nero_3D - 17.02.2013

You need to use OnPlayerStateChange
pawn Код:
if(oldstate == PLAYER_STATE_DRIVER) {
    // your saving code
}
That will also works if you fall of a bike


Re: Save a vehicule position - Vlaoff - 17.02.2013

Thanks, i think about updating it when a player deconect (of course i'll check if he is in a vehicule before ).