SA-MP Forums Archive
OnPlayerDisconnect vehicle despawn - 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: OnPlayerDisconnect vehicle despawn (/showthread.php?tid=411756)



OnPlayerDisconnect vehicle despawn - dthompson - 30.01.2013

Hey guys,

I am using the AVS filterscript for vehicles on a small server I am creating.
I am wondering how (if possible) to code a way so that a player's vehicles destroy once they log off and respawn when they log on.

https://sampforum.blast.hk/showthread.php?tid=276887

Cheers.


Re: OnPlayerDisconnect vehicle despawn - denNorske - 30.01.2013

A suggestion could be to set a variable when you spawn a vehicle, saving it to an INI file when you diconnect, and then load the information from the INI file when you spawn again.

I suggest to use DINI or Y_INI to save it in a INI file. Set the variable when vehicle is spawned


Re: OnPlayerDisconnect vehicle despawn - dthompson - 30.01.2013

Well; is there a way of getting a certain line of the .ini file? For example, I could get it to save the player's name in the .ini file but how would I get the script to read it when the player joins?


Re: OnPlayerDisconnect vehicle despawn - denNorske - 30.01.2013

Save the name into the ini file when you create on using "GetPlayerName" :P
You can check if the file exists with if(fexist(Filepath/name)) , and then load the information from the file if it exists. That is usually done on "OnPlayerConnect" ^^