Need help
#3

PHP код:
    if(strcmp(cmd"/makeadmin"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /makeadmin [playerid/PartOfName] [level(1-3)]");
                return 
1;
            }
            new 
para1;
            new 
level;
            
para1 ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            
level strval(tmp);
            if (
PlayerInfo[playerid][pAdmin] >= 10)
            {
                if(
IsPlayerConnected(para1))
                {
                    if(
para1 != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(playeridnamesizeof(name));
                        
CMDLog(name,cmdtext);
                        
GetPlayerName(para1giveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
GiveNameSpace(sendername);
                        
GiveNameSpace(giveplayer);
                        if(
PlayerInfo[playerid][pAdmin] == 11) { sendername "Hidden Admin"; }
                        new 
Float:shealth;
                        
GetPlayerHealth(para1,shealth);
                        
SetPlayerHealthEx(para1,shealth);
                        new 
Float:darmour;
                        
GetPlayerArmour(para1,darmour);
                        
SetPlayerArmourEx(para1,darmour);
                        
PlayerInfo[para1][pAdmin] = level;
                        
//printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
                        
format(stringsizeof(string), "   You have been promoted to a level %d admin by %s"levelsendername);
                        
SendClientMessage(para1COLOR_WHITEstring);
                        
format(stringsizeof(string), "   You have promoted %s to a level %d admin."giveplayer,level);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "[ID: %d]  %s has promoted %s [ID: %d] to a level %d admin."playeridsendernamegiveplayerpara1,level);
                        
ABroadCast(COLOR_YELLOWstring1);
                        
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   You are not authorized to use that command!");
            }
        }
        return 
1;
    } 
Reply


Messages In This Thread
Need help - by NealPeteros - 30.08.2016, 04:45
Re: Need help - by SoLetsGO - 30.08.2016, 05:27
Re: Need help - by NealPeteros - 30.08.2016, 05:59

Forum Jump:


Users browsing this thread: 1 Guest(s)