how to create the command /setadmin with rcon with pawno?
#1

how to
Reply
#2

PHP код:
CMD:setadmin(playeridparams[])
{
    new 
pIDvalue;
    if(
PlayerInfo[playerid][pAdmin] < && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid0xFF0000AA"[SERVER]: You're not authorized to use this command!");
    else if (
sscanf(params"ui"pIDvalue)) return SendClientMessage(playerid0xFF0000AA"Usage: /setadmin [playerid/partofname] [level]");
    else if (
value || value 1338) return SendClientMessage(playerid0xFF0000AA"[SERVER]: UNKNOWN LEVEL!");
    else if(
pID == INVALID_PLAYER_ID) return SCM(playeridCOLOR_GREY,"[SERVER]: Invalid player ID");
    else
    {
           new 
pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME], string[128];
           
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
        
GetPlayerName(pIDtNameMAX_PLAYER_NAME);
        
format(stringsizeof(string), "[SERVER]: You have promoted %s to Admin level %i"tNamevalue);
        
SCM(playeridCOLOR_LIGHTREDstring);
        
format(stringsizeof(string), "[SERVER]: Congratulations, you have been promoted to Admin level %i by %s"valuepName);
        
SCM(pIDCOLOR_LIGHTREDstring);
        
PlayerInfo[pID][pAdmin] = value;
    }
    return 
1;

Don't really understand your question, but here's the pawno version
Reply
#3

in what part i put it?
Reply
#4

Quote:
Originally Posted by michael_dark_1
Посмотреть сообщение
in what part i put it?
in any part, this is using zcmd so it does not need to put it in OnPlayerText or so, you can put it in the end of the script maybe.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)