OnPlayerDisconnect vehicle despawn
#1

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.
Reply
#2

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
Reply
#3

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?
Reply
#4

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" ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)