help in saving/loading player health
#1

please tell me how can i save and load players health. with .ini file
Reply
#2

Quote:
Originally Posted by danish007
Посмотреть сообщение
please tell me how can i save and load players health. with .ini file
You already have thread for this. There is absolutely no need to create another.
Reply
#3

please help me
Reply
#4

try thissss

Quote:

enum PlayerInfo
{
Floatavehealth,
Floatavearmor,
}

new pInfo[MAX_PLAYERS][PlayerInfo];

Quote:

forward loadaccount_user(playerid, name[], value[]);
public loadaccount_user(playerid, name[], value[])
{
INI_Float("savehealth",pInfo[playerid][savehealth]);
INI_Float("savearmor",pInfo[playerid][savearmor]);
return 1;
}

Quote:

public OnPlayerDisconnect(playerid, reason)
{
GetPlayerHealth(playerid, pInfo[playerid][savehealth]);
GetPlayerArmour(playerid, pInfo[playerid][savearmor]);

new INI:file = INI_Open(Path(playerid));
INI_SetTag(file,"Player Information");
INI_WriteFloat(file,"savehealth",pInfo[playerid][savehealth]);
INI_WriteFloat(file,"savearmor",pInfo[playerid][savearmor]);
INI_Close(file);
return 1;
}
pInfo[playerid][savehealth]=0;
pInfo[playerid][savearmor]=0;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)