[HELP]setlevel admin sa-mp
#6

pawn Код:
if (!strcmp("/settaadmin", cmdtext, true, 11))
{
    new id;
    if (pInfo[playerid][Admin] < 5 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "ERROR: You are not a level 5 admin!");
    if (sscanf(cmdtext[12], "ui", id, level))
    {
        SendClientMessage(playerid, LBLUE, "Usage: /setlevel (playerid) (level)") &&
        return SendClientMessage(playerid, GREEN, "Function: Set a person a admin");
    }
    if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "ERROR: That is a invalid player ID");
    new str[100];
    format(str, sizeof (str), "UPDATE `playerinfo` SET `Admin` = %d WHERE `User` = '%s'", level, pName(id));
    // ??? Execute query
    format(str, sizeof (str), "|- Administrator %s has made %s (%d) admin level %d -|", pName(playerid), pName(id), id, level);
    PlayerInfo[id][Admin] = level; // setting the level of the "id", not "playerid" as you wrote.
    return 1;
}
However I agree with what ChandraLouis suggested.
Reply


Messages In This Thread
[HELP]setlevel admin sa-mp - by falco3205 - 04.03.2014, 08:46
Re: [HELP]setlevel admin sa-mp - by HK - 04.03.2014, 09:08
Re: [HELP]setlevel admin sa-mp - by falco3205 - 04.03.2014, 09:17
Re: [HELP]setlevel admin sa-mp - by ChandraLouis - 04.03.2014, 09:19
Re: [HELP]setlevel admin sa-mp - by HK - 04.03.2014, 09:19
Re: [HELP]setlevel admin sa-mp - by Konstantinos - 04.03.2014, 09:44
Re: [HELP]setlevel admin sa-mp - by Nurgle4 - 04.03.2014, 10:17
Re: [HELP]setlevel admin sa-mp - by falco3205 - 04.03.2014, 10:33

Forum Jump:


Users browsing this thread: 1 Guest(s)