SA-MP Forums Archive
Vehicle system example? - 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: Vehicle system example? (/showthread.php?tid=208181)



Vehicle system example? - ajwar - 07.01.2011

Hi, can anyone show me a short example of loading vehicle's from MYSQL db and checking on OnPlayerEnterVehicle if the car belongs to owner? I don't need any working variables just show me how should it look like, becouse i can't get my vehicle system work corectly...


Re: Vehicle system example? - veyron - 07.01.2011

i used for loop (with mysql_num_rows() function) ands sscanf to load it from mysql table to variables
to detect if player owns vehicle i used strcmp with player name and vehicle owner name under OnPlayerStateChange (if newstate == PLAYER_STATE_DRIVER)
I hope this helps you.