OnPlayerDisconnect
#1

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

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

the best and easy to use is djson by dracoblue
Reply
#4

but, I am making my own, I dont want any adds and so. Can anyone do nice code for me, please.
Thanks!
Reply
#5

Anymore help?
Reply
#6

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" );
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)