save team - 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: save team (
/showthread.php?tid=219915)
save team -
Amine_Mejrhirrou - 02.02.2011
hi all
i want to aske yu guys ! do you know if it's posible to save the team of a player when he disconect
Re: save team -
California - 02.02.2011
Yes, use a file system and save the gTeam variable into the file, and when the player disconnects, reset the team, when the player connects, set the team.
Then when OnPlayerRequestClass is called, if the player's team was loaded and is not 255, spawn him automatically.
I'm not making the code for you, this is just an example. If you want the code, go
here or just learn how to script
here.
Re: save team -
alpha500delta - 02.02.2011
Sure it is. Use Dini, or Y_Ini whatever you wanna use
Re : save team -
Amine_Mejrhirrou - 02.02.2011
i've creat a "saveteam" it work perfectly (when i relog in the servre ! i still in tha same team !)
NOW probleme is if i close
samp-server.exe & run it again ! the "saveteam" set the player to team 0 (not to the laste team )
any solution pls
Re: Re : save team -
California - 03.02.2011
Quote:
Originally Posted by Amine_Mejrhirrou
i've creat a "saveteam" it work perfectly (when i relog in the servre ! i still in tha same team !)
NOW probleme is if i close samp-server.exe & run it again ! the "saveteam" set the player to team 0 (not to the laste team )
any solution pls
|
Loop through all players using OnGameModeExit, then save the data and end the loop.