sscanf warning: Format specifier does not match parameter count.
#1

pawn Код:
CMD:asethp(playerid, params[])
{
    if(GetPVarInt(playerid, "LoggedIn") == 0) return SendClientMessage(playerid, -1, "ERROR: You are not logged in.");
    if(Player[playerid][AdminLevel] >= 3)
    {
        new string[128], id, amount;
        if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, -1, "Command Usage: /asethp [playerid] [amount]");
        if(id != INVALID_PLAYER_ID)
        {
            Player[id][Health] = amount;
            SetPlayerHealth(id, amount);
            format(string, sizeof(string), "[AdminCMD] You have set %s's health to %i.", GetName(id), amount);
            SendClientMessage(playerid, COLOR_LIGHTRED, string);
            format(string, sizeof(string), "[AdminCMD] Your health has been set to %i by %s.", amount, GetName(playerid));
            SendClientMessage(id, COLOR_LIGHTRED, string);
        }
        else return SendClientMessage(playerid, -1, "That player is not online.");
    }
    else return SendClientMessage(playerid, -1, ADMIN);
    return 1;
}
I can't see what's wrong with it, maybe it's just something painfully obvious and I'm just not seeing it :/
Reply
#2

I send my sethealth command, to compare beetween them ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)