Errors with this command
#7

PHP код:
CMD:makegroupleader(playeridparams[]) {
    if(
PlayerInfo[playerid][pAdmin] >= 4){
        new 
string[512], iTargetIDiGroupID;
        if(
sscanf(params"ud"iTargetIDiGroupID))
            return 
SendClientMessage(playeridCOLOR_GRAD1,"/makegroupleader [playerid] [groupid(/listgroups)]");
        if(
iGroupID MAX_GROUPS && iGroupID != 255 || iGroupID 0) {
            
format(stringsizeof(string),"Invalid group, ranges from 0 to %i & 255 - Remove."MAX_GROUPS);
            
SendClientMessage(playeridCOLOR_GREYstring);
            return 
1;
        }
        if(
IsPlayerConnected(iTargetID)) {
            if(
PlayerData[iTargetID][pGangID] != 255)
                return 
SendClientMessage(playeridCOLOR_GRAD1"The specified player is in a gang.");
            if(
iGroupID == 255) {
                if(
pTazer{iTargetID} == 1) {
                    
RemovePlayerWeapon(iTargetID23);
                    if(
pTazerReplace{iTargetID} > 0)
                        
GivePlayerValidWeapon(iTargetIDpTazerReplace{iTargetID}, 60000);
                    
pTazer{iTargetID} = 0;
                    
pTazerReplace{iTargetID} = 0;
                }
                
format(stringsizeof(string), "Your leadership has been taken by Administrator %s."getPlayerName(playerid));
                
SendClientMessage(iTargetIDCOLOR_LIGHTBLUEstring);
                
format(stringsizeof(string), "You have taken %s leadership."getPlayerName(iTargetID));
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                
format(stringsizeof(string), "%s has taken %s leadership."getPlayerName(playerid), getPlayerName(iTargetID));
                  
Log("logs/makeleader.log"string);
                
PlayerData[iTargetID][pRank] = 255;
                
PlayerData[iTargetID][pDivision] = 255;
                
PlayerData[iTargetID][pLeader] = 255;
                
PlayerData[iTargetID][pFaction] = 255;
                
HitmanBadge[iTargetID] = 255;
                return 
1;
            }
            if(
GroupData[iGroupID][g_szGroupName][0] == 0)
                return 
SendClientMessage(playeridCOLOR_GRAD1"The specified group has not been setup.");
            if(
GroupData[iGroupID][g_iDisabled] == 1)
                return 
SendClientMessage(playeridCOLOR_GRAD1"You cannot make anyone the leader of this group, it's disabled.");
            new 
iRankCount 0;
            for(new 
0MAX_GROUP_RANKSi++) {
                if(
strlen(GroupRanks[iGroupID][i]) >= && strcmp(GroupRanks[iGroupID][i], "None"true)) {
                    ++
iRankCount;
                }
            }
            
PlayerData[iTargetID][pLeader] = iGroupID;
            
PlayerData[iTargetID][pRank] = iRankCount-1;
            
PlayerData[iTargetID][pFaction] = iGroupID;
            
PlayerData[iTargetID][pDivision] = 0;
            
format(stringsizeof(string), "You have been made the leader of the %s by Administrator %s."GroupData[iGroupID][g_szGroupName], getPlayerName(playerid));
            
SendClientMessage(iTargetIDCOLOR_LIGHTBLUEstring);
            
format(stringsizeof(string), "You have made %s the leader of the %s."getPlayerName(iTargetID), GroupData[iGroupID][g_szGroupName]);
            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
            
format(stringsizeof(string), "%s had made %s the leader of %s (%i)."getPlayerName(playerid), getPlayerName(iTargetID), GroupData[iGroupID][g_szGroupName], iGroupID);
              
Log("logs/makeleader.log"string);
            
PlayerData[iTargetID][pDuty] = 0;
            
SetPlayerToTeamColor(iTargetID);
        }
    }
    else 
Invalid_Admin(playerid);
    return 
1;

Reply


Messages In This Thread
Errors with this command - by Rydur - 02.01.2014, 11:45
Re: Errors with this command - by WhiteNigger - 02.01.2014, 11:52
Re: Errors with this command - by Konstantinos - 02.01.2014, 11:56
Re: Errors with this command - by Rydur - 02.01.2014, 12:10
Re: Errors with this command - by camaro8 - 02.01.2014, 12:14
Re: Errors with this command - by Rydur - 02.01.2014, 12:16
Re: Errors with this command - by camaro8 - 02.01.2014, 12:20
Re: Errors with this command - by Rydur - 02.01.2014, 12:26
Re: Errors with this command - by HB - 02.01.2014, 12:30
Re: Errors with this command - by Rydur - 02.01.2014, 13:06

Forum Jump:


Users browsing this thread: 1 Guest(s)