04.02.2015, 13:43
Hello, i've made a saving/loading health for my server but it does load 100 hp! even i checked there is no any function added in my server which loadfs full hp or setplayerhealth(playerid, 100);
so doest not save porperly and loadproperly...
its saving is;
saving code;
Loading code;
setting saved health..... used under onplayerspawn
it does not load saved health it just load full hp!
so doest not save porperly and loadproperly...
its saving is;
pawn Код:
LvHealth = 100.000000
pawn Код:
new string[128];
GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
format(string, sizeof(string), "%.0f",PlayerInfo[playerid][pHealth]);
PlayerInfo[playerid][pHealth] = strval(string);
new INI:File = INI_Open(UserPath(playerid));
INI_WriteFloat(File, "LvHealth",PlayerInfo[playerid][pHealth]);
INI_Close(File);
pawn Код:
INI_Float("LvHealth",PlayerInfo[playerid][pHealth]);
pawn Код:
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);