Need help with Stats Saving.
#1

Pastebin <--- Link.
I made this from Kush's tutorial and i have something wrong it doesnt save stats/load. In file 0's doesnt change i see-> scriptfiles/Users/Name.txt
PHP код:
[data]
Password = ***
Admin 0
Cash 
0
Kills 
0
Deaths 
0
Cookies 

I have /Kill wich add death and when player die it adds death so when i type /stats it showing me 2deaths but it doesn't save i writed from that tutorial with my own hands because i want learn Something is wrong?
Reply
#2

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s left from server!",pName);
    SendClientMessageToAll(COLOR_GREY,string);
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"Cookies",PlayerInfo[playerid][pCookies]);
   INI_Close(File); //Close the file
    return 1;
}
Reply
#3

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s left from server!",pName);
    SendClientMessageToAll(COLOR_GREY,string);
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"Cookies",PlayerInfo[playerid][pCookies]);
   INI_Close(File); //Close the file
    return 1;
}
Thank you!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)