Save player health on log off?
#1

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]));
Reply
#2

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

Yes, it's working. Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)