Error Command /makeadmin
#3

pawn Код:
stock PlayerName(playerid)
{
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
    return playername;
}

CMD:makeadmin(playerid,params[])
{
    new pID, value;
    if(IsPlayerAdmin(playerid))
    {
        if(sscanf(params, "ud", pID, value)) return SendClientMessage(playerid, -1, "Usage: /setadmin (id) (level)");
        else if(value < 0 || value > 3) return SendClientMessage(playerid, -1, "Only levels 0-3");
        else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player Is Not Currently Connected");
        else
        {
            new string[128];
            format(string, sizeof(string), "You have set %s Admin level to %d", PlayerName(pID), value);
            SendClientMessage(playerid, -1, string);
            format(string, sizeof(string), "Your Admin level has been set to %d by %s", value, pName(playerid));
            SendClientMessage(pID, -1, string);
            PlayerInfo[pID][pAdmin] = value;
        }
    }
    return 1;
}
i hope its work.

error 017: undefined symbol "PlayerName"
Reply


Messages In This Thread
Error Command /makeadmin - by Tihoy232 - 29.03.2018, 07:34
Re: Error Command /makeadmin - by BulletRaja - 29.03.2018, 08:00
Re: Error Command /makeadmin - by kecoajepit - 29.03.2018, 08:06
Re: Error Command /makeadmin - by wallen - 29.03.2018, 09:25
Re: Error Command /makeadmin - by BulletRaja - 29.03.2018, 09:38

Forum Jump:


Users browsing this thread: 1 Guest(s)