PHP Code:
#define PATH "/Users/%s.ini"
PHP Code:
enum pInfo
{
pLevel,
pPass,
pScore,
pCash,
pAdmin,
pVip,
pKill,
pDeath,
pSkin,
pAllKill,
pAllDeath,
}
PHP Code:
public OnPlayerDisconnect(playerid, reason)
{
if(tijek == 2)
{
new msg[128];
format(msg, sizeof(msg), "{ff0000}Duel izmedju %s(%d) i %s(%d) je zavrsio. Razlog: Vrijeme isteklo!", PlayerName(duel1), duel1, PlayerName(duel2), duel2);
SendClientMessageToAll(-1, msg);
tijek =0;
}
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Vip",PlayerInfo[playerid][pVip]);
INI_WriteInt(File,"Kill",PlayerInfo[playerid][pKill]);
INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
INI_WriteInt(File,"Death",PlayerInfo[playerid][pDeath]);
INI_Close(File);
////////////
return 1;
}
PHP Code:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
INI_Int("Vip",PlayerInfo[playerid][pVip]);
INI_Int("Kill",PlayerInfo[playerid][pKill]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
INI_Int("Death",PlayerInfo[playerid][pDeath]);
INI_Int("Skin", PlayerInfo[playerid][pSkin]);
return 1;
}
PHP Code:
stock SavePlayer(playerid)
{
new INI:File = INI_Open(Korisnici(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Vip",PlayerInfo[playerid][pVip]);
INI_WriteInt(File,"Kill",PlayerInfo[playerid][pKill]);
INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
INI_WriteInt(File,"Death",PlayerInfo[playerid][pDeath]);
INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
INI_Close(File);
return 1;
}