Set Admin Level command
#3

PHP код:
if(strcmp(cmd"/makeadmin"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pAdmin] >= 99998)
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /makeadmin [playerid/PartOfName] [level]");
                    return 
1;
                }
                new 
para1;
                new 
level;
                
para1 ReturnUser(tmp);
                
tmp strtok(cmdtextidx);
                
level strvalEx(tmp);
                if(
IsPlayerConnected(para1))
                {
                    if(
para1 != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(para1giveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
PlayerInfo[para1][pAdmin] = level;
                        
printf("Info: %s has promoted %s to a level %d admin."sendernamegiveplayerlevel);
                        
format(stringsizeof(string), "   You have been promoted to a level %d admin by %s"levelsendername);
                        
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "   You have promoted %s to a level %d admin."giveplayer,level);
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                }
            }
        }
        return 
1;
    } 
Done.
Reply


Messages In This Thread
Set Admin Level command - by IvancheBG - 16.09.2012, 08:46
Re: Set Admin Level command - by BadgerLedger - 16.09.2012, 09:18
Re: Set Admin Level command - by Sig Hansen - 16.09.2012, 09:24
Re: Set Admin Level command - by IvancheBG - 16.09.2012, 09:45
AW: Set Admin Level command - by BiosMarcel - 16.09.2012, 09:49
Re: AW: Set Admin Level command - by clarencecuzz - 16.09.2012, 09:52
AW: Set Admin Level command - by BiosMarcel - 16.09.2012, 09:53
Re: Set Admin Level command - by IvancheBG - 16.09.2012, 09:55
AW: Set Admin Level command - by BiosMarcel - 16.09.2012, 09:56
Re: Set Admin Level command - by IvancheBG - 16.09.2012, 09:58

Forum Jump:


Users browsing this thread: 2 Guest(s)