OnPlayerDisconnect - 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: OnPlayerDisconnect (
/showthread.php?tid=112582)
OnPlayerDisconnect -
Ironboy500 - 08.12.2009
Hello all! I need a little help about my Admin FS. My stats are working good, but after player logout or servers restarts stats reset to 0. So what should I add under OnPlayerDisconnect so when player disconnect all his stats (Kills, Deaths, Money, Admin Level) saves to file. Please help and look at pastebin. Thanks!
http://pastebin.com/m617aeadb
Re: OnPlayerDisconnect -
Malice - 08.12.2009
You can use one of the many file includes available. Most of which are made by dracoblue. There is dudb and a new faster one. I forget what it's called. Just search his posts.
Found:
DJson -
http://forum.sa-mp.com/index.php?topic=71125.0
I haven't tried it but it seems good.
Re: OnPlayerDisconnect -
MPKaboose - 08.12.2009
the best and easy to use is djson by dracoblue
Re: OnPlayerDisconnect -
Ironboy500 - 08.12.2009
but, I am making my own, I dont want any adds and so. Can anyone do nice code for me, please.
Thanks!
Re: OnPlayerDisconnect -
Ironboy500 - 08.12.2009
Anymore help?
Re: OnPlayerDisconnect -
LarzI - 08.12.2009
pawn Код:
dini_IntSet( "nameoffile", "aLevel", PlayerInfo[ playerid ][ AdminLevel ] );
dini_IntSet( "nameoffile", "Cash", PlayerInfo[ playerid ][ Cash ] );
dini_IntSet( "nameoffile", "Kills", PlayerInfo[ playerid ][ Kills ] );
dini_IntSet( "nameoffile", "Deaths", PlayerInfo[ playerid ][ Deaths ] );
Put that in OnPlayerDisconnect ^^^
You should also add this in your /login command (under SetPlayerMoney)
pawn Код:
PlayerInfo[ playerid ][ Kills ] = dini_Int( "nameoffile", "Kills" );
PlayerInfo[ playerid ][ Deaths ] = dini_Int( "nameoffile", "Deaths" );