Save player health on log off? - 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 player health on log off? (
/showthread.php?tid=215519)
Save player health on log off? -
Outcast - 23.01.2011
Well, I want it that when a player logs off, his health and armor will be saved in his userfile.
I tried making it but when I check it in a file, it says that health and armor are 1.
This is the code I use on savestats(playerid) callback.
pawn Код:
djSetInt(file, "player/health",GetPlayerHealth(playerid,Float:PlayerInfo[playerid][Health]));
Re: Save player health on log off? -
Mike Garber - 23.01.2011
You need to use djSetFloat (if any) and If there's any do;
(I'm not familiar with djson)
new Float:Health;
GetPlayerHealth(playerid,Health);
djSetFloat(file,"FILENAME",Health);
Re: Save player health on log off? -
Outcast - 23.01.2011
Yes, it's working. Thanks