how to make a set admin command with yini and zcmd
#3

Try this
pawn Код:
CMD:setadmin(playerid, params[])
{
    new pID, value;
    if(!IsPlayerAdmin(playerid)) return 0;
    else if(sscanf(params, "ui", 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 %i", PlayerName(pID), value);
        SendClientMessage(playerid, -1, string);
        format(string, sizeof(string), "Your Admin level has been set to %i by %s", value, PlayerName(playerid));
        SendClientMessage(pID, -1, string);
        PlayerInfo[pID][pAdmin] = value;
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)