setadmin command
#1

Hello guys i have this /setadmin command :

PHP код:
CMD:setadmin(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= || IsPlayerAdmin(playerid))
    {
        new 
astring[100];
        if(
sscanf(params"ud"targetidlevel)) return SendClientMessage(playerid, -1"/SetStaff [ID] [Level 1-6]");
        if(
level 6) return SendClientMessage(playerid,-1,"LEVELS AVAILABLE 1-6!");
        if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,"{F81414}ID not found ");
        if(
PlayerInfo[playerid][pAdmin] == level) return SendClientMessage(playerid, -1"{F81414}That person is already this Administrator level!");
        
GetPlayerName(playerid,aNameMAX_PLAYER_NAME);
        
GetPlayerName(targetid,pName,MAX_PLAYER_NAME);
        
PlayerInfo[targetid][pAdmin] = level;
        
format(astringsizeof(astring),"Administrator %s has set your Administrator level to %d on the server.",aName,level);
        
SendClientMessage(targetid,-1,astring);
        
format(astringsizeof(astring),"You had set %s's Administrator level to %d!",pName,level);
        
SendClientMessage(playerid,-1,astring);
    }
    return 
1;

i have maximum 6 admin levels i want level 5 admin can only give level 4 or less and i want admin level 6 to give any level he wants from 0 to 6 so is it possible to do it in one command if yes then please dit my command which i posted above
Reply
#2

Basic logic: if player's level is equal to 5 and level is >= 5 return error
Reply


Forum Jump:


Users browsing this thread: