Saving/Loading Player's Health
#1

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;
pawn Код:
LvHealth = 100.000000
saving code;
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);
Loading code;
pawn Код:
INI_Float("LvHealth",PlayerInfo[playerid][pHealth]);
setting saved health..... used under onplayerspawn
pawn Код:
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
it does not load saved health it just load full hp!
Reply


Messages In This Thread
Saving/Loading Player's Health - by danish007 - 04.02.2015, 13:43
Re: Saving/Loading Player's Health - by ATGOggy - 04.02.2015, 14:15
Re: Saving/Loading Player's Health - by MarcGonzales - 04.02.2015, 14:15
Re: Saving/Loading Player's Health - by Vince - 04.02.2015, 14:19
Re: Saving/Loading Player's Health - by danish007 - 04.02.2015, 15:25
Re: Saving/Loading Player's Health - by ATGOggy - 04.02.2015, 15:31
Re: Saving/Loading Player's Health - by danish007 - 04.02.2015, 15:33
Re: Saving/Loading Player's Health - by danish007 - 04.02.2015, 18:15
Re: Saving/Loading Player's Health - by danish007 - 04.02.2015, 19:12
Re: Saving/Loading Player's Health - by danish007 - 05.02.2015, 11:08

Forum Jump:


Users browsing this thread: 2 Guest(s)