Two problems.
#1

1.
Okay. Why I am getting on next log in if player logged out with 100 HP?
Код:
This is taken from players info file .ini, after logging off with 100hp.

Health=1.000000
Armour=1.000000
Here is code how I save it.

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new Float: health;
    new Float: armour;
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if(gPlayerLogged[playerid] == 1)
    {
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdmin]);
        dini_FloatSet(file, "Health",GetPlayerHealth(playerid, health));
        dini_FloatSet(file, "Armour",GetPlayerArmour(playerid, armour));
        dini_IntSet(file, "Cash",GetPlayerMoney(playerid));
        dini_IntSet(file, "Level",GetPlayerScore(playerid));
    }
    gPlayerLogged[playerid] = 0;
    return 1;
}


2.
Whats wrong with this command? Command just doesn't work.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext,"/heal",true))
    {
        new pID, health;
        if(PlayerInfo[playerid][pAdmin] >= 0)
        if(!sscanf(cmdtext, "ui", pID, health))
        {
            SetPlayerHealth(pID, health);
            SendClientMessage(playerid, -1, "You have successfully set players health!");
        }
        else return SendClientMessage(playerid, -1, "Usage: /heal [PlayerID][Amount]");
        return 1;
    }
    return 1;
}
Reply


Messages In This Thread
Two problems. - by Kasis - 21.06.2011, 15:11
Re: Two problems. - by Scenario - 21.06.2011, 15:14
Re: Two problems. - by Kasis - 21.06.2011, 15:19
Re: Two problems. - by Kasis - 21.06.2011, 21:21
Re: Two problems. - by Sasino97 - 21.06.2011, 21:45
Re: Two problems. - by Jeffry - 22.06.2011, 10:17
Re: Two problems. - by Kasis - 22.06.2011, 10:48

Forum Jump:


Users browsing this thread: 5 Guest(s)