Saving problem
#1

Well, I did this.

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(P_Logged[playerid] == 1)
    {
       new INI:File = INI_Open(UserPath(playerid));
       INI_SetTag(File,"Account Data");
       INI_WriteInt(File,"Admin",PlayerInfo[playerid][P_Admin]);
       INI_WriteInt(File,"Kills",PlayerInfo[playerid][P_Kills]);
       INI_WriteInt(File,"Deaths",PlayerInfo[playerid][P_Deaths]);
       INI_WriteInt(File,"Money",GetPlayerMoney(playerid));
       INI_WriteInt(File,"Interior",GetPlayerInterior(playerid));
       INI_WriteInt(File,"VirtualWorld",GetPlayerVirtualWorld(playerid));
       INI_WriteFloat(File,"Health",PlayerInfo[playerid][P_Health]);
       INI_WriteFloat(File,"Armour",PlayerInfo[playerid][P_Armour]);
       INI_Close(File);
       
       GetPlayerHealth(playerid, P_Health);
       GetPlayerArmour(playerid, P_Armour);
    }
    return 1;
}
And got this.

pawn Код:
Gamemode.pwn(96) : error 035: argument type mismatch (argument 2)
Gamemode.pwn(97) : error 035: argument type mismatch (argument 2)
Reply
#2

please replace
pawn Код:
GetPlayerHealth(playerid, P_Health);
       GetPlayerArmour(playerid, P_Armour);
By
pawn Код:
GetPlayerHealth(playerid, PlayerInfo[playerid][P_Health]);
GetPlayerArmour(playerid, PlayerInfo[playerid][P_Armour]);
(sorry for my bad english)
Reply
#3

Quote:
Originally Posted by leo3412
Посмотреть сообщение
please replace
pawn Код:
GetPlayerHealth(playerid, P_Health);
       GetPlayerArmour(playerid, P_Armour);
By
pawn Код:
GetPlayerHealth(playerid, PlayerInfo[playerid][P_Health]);
GetPlayerArmour(playerid, PlayerInfo[playerid][P_Armour]);
(sorry for my bad english)
Indeed, that looks fine.

@Thread maker, you also forgot to GetPlayerHealth AND GetPlayerArmour BEFORE setting it into the file.

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(P_Logged[playerid] == 1)
    {
        new INI:File = INI_Open(UserPath(playerid));
        GetPlayerHealth(playerid, PlayerInfo[playerid][P_Health]);
        GetPlayerArmour(playerid, PlayerInfo[playerid][P_Armour]);
        INI_SetTag(File,"Account Data");
        INI_WriteInt(File,"Admin",PlayerInfo[playerid][P_Admin]);
        INI_WriteInt(File,"Kills",PlayerInfo[playerid][P_Kills]);
        INI_WriteInt(File,"Deaths",PlayerInfo[playerid][P_Deaths]);
        INI_WriteInt(File,"Money",GetPlayerMoney(playerid));
        INI_WriteInt(File,"Interior",GetPlayerInterior(playerid));
        INI_WriteInt(File,"VirtualWorld",GetPlayerVirtualWorld(playerid));
        INI_WriteFloat(File,"Health",PlayerInfo[playerid][P_Health]);
        INI_WriteFloat(File,"Armour",PlayerInfo[playerid][P_Armour]);
        INI_Close(File);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)