help again please [ sorry ]
#5

It isn't that hard

pawn Код:
CMD:setlevel(playerid, params[])
{
    if(PInfo[playerid][pAdmin] >= 5)
    {
        new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
        if (sscanf(params, "ud", id, admlvl)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /setadmin [id] [adminlevel]");
        if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player.");
        if (admlvl > 6 || admlvl < 0) return SendClientMessage(playerid, COLOR_WHITE,"Levels only from 1 - 6");

        GetPlayerName(id, victimname, sizeof(victimname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        new str[128];
        format(str,128,"You have gave admin level %i to %s[ID %d]", admlvl, victimname, id);
        SendClientMessage(playerid, COLOR_WHITE, str);

        format(str,128,"Admin %s[ID %d] gave you admin level %i", adminname, playerid, admlvl);
        SendClientMessage(id, COLOR_WHITE, str);

        format(str,128,"Admin %s[ID %d] has set %s [ID %d] admin level to %i",adminname, playerid, victimname, id, admlvl);
        SendClientMessageToAll(COLOR_WHITE,str);

        return PInfo[playerid][pAdmin] = admlvl;
    }
    else return AdminCMD(playerid, 5);
}
Just "ds" to "ud"
Reply


Messages In This Thread
help again please [ sorry ] - by Artix - 24.12.2011, 19:40
Re: help again please [ sorry ] - by Artix - 24.12.2011, 20:01
Re: help again please [ sorry ] - by [HiC]TheKiller - 24.12.2011, 20:02
Re: help again please [ sorry ] - by Artix - 24.12.2011, 20:05
Re: help again please [ sorry ] - by Jakku - 24.12.2011, 20:17
Re: help again please [ sorry ] - by Dark_Kostas - 24.12.2011, 20:26

Forum Jump:


Users browsing this thread: 1 Guest(s)