Makeadmin Command (zcmd)
#5

Quote:
Originally Posted by NinjahZ
Посмотреть сообщение
I need someone to direct me to a tutorial that makes this command
Quote:
Originally Posted by Rafael_Zambrano
Посмотреть сообщение
i guess that this will run
pawn Код:
COMMAND:setadmin(playerid, params[])
{

        if(PlayerInfo[playerid][Adminlevel] <= 5) return SendClientMessage(playerid, -1, "AdmCmd: You don't have the privilege to use this command.");
        new
            string[1000],playerid,level;
        if(sscanf(params, "ui", playerid,level)) return SendClientMessage(playerid, -1, "Info: /Setadmin (Playerid) (Adminlevel)");
        if(playerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Error: Wrong Playerid.");
        if(level >= 8 || level <= 0) return SendClientMessage(playerid,-1,"Error: Max admin level is ( 7 ).");
        format(string,sizeof(string),"AdmCmd: Administrator \"%s (%d)\" has set your admin level to ( Level: %d ).",GetName(playerid),playerid,level);
        SendClientMessage(playerid,-1,string);
        format(string,sizeof(string),"AdmCmd: You have set player \"%s (%d)\" admin level to ( Level: %d ).",GetName(playerid),playerid,level);
        SendClientMessage(playerid,-1,string);
        PlayerInfo[playerid][Adminlevel] = level;
        return 1;
}
also you may define
pawn Код:
#define SCM  SendClientMessage
thats if you don't want to write SendClientMessage
I know you're trying to help an' all, but he asked for a tutorial, not a command you've ripped out of a script. Binx was correct by adding comments to let the beginner know what was happening.
Reply


Messages In This Thread
Makeadmin Command (zcmd) - by NinjahZ - 08.08.2013, 04:24
Re: Makeadmin Command (zcmd) - by Binx - 08.08.2013, 05:00
Respuesta: Makeadmin Command (zcmd) - by RafaelZam - 08.08.2013, 05:03
Re: Makeadmin Command (zcmd) - by NinjahZ - 08.08.2013, 05:05
Re: Respuesta: Makeadmin Command (zcmd) - by Elysian` - 08.08.2013, 05:06

Forum Jump:


Users browsing this thread: 1 Guest(s)