Need Cmd Uninviteall
#1

hi... bro, can help me? i need cmd /ouninviteall, for uninvite all players from factions.

PHP код:
CMD:ouninvite(playeridparams[]) {
    if (
PlayerInfo[playerid][pLeader] >= || PlayerInfo[playerid][pAdmin] >= 7) {
        if(
isnull(params)) {
            return 
SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /uninvite [name]");
        }
        if(!
doesAccountExist(params)) {
            return 
SendClientMessageEx(playeridCOLOR_WHITE"That account does not exist!");
        }
        
OnPlayerOfflineLogin(params);
        if(
PlayerInfo[MAX_PLAYERS][pAdmin] >= || PlayerInfo[MAX_PLAYERS][pFactionModerator] == 1) {
            return 
SendClientMessageEx(playeridCOLOR_WHITE"You can not uninvite this person.");
        }
        else if ((
PlayerInfo[MAX_PLAYERS][pMember] == PlayerInfo[playerid][pLeader]) && (PlayerInfo[MAX_PLAYERS][pLeader] == || PlayerInfo[MAX_PLAYERS][pRank] < PlayerInfo[playerid][pRank])) {
            
PlayerInfo[MAX_PLAYERS][pMember] = 0;
            
PlayerInfo[MAX_PLAYERS][pRank] = 0;
            
PlayerInfo[MAX_PLAYERS][pChar] = 0;
            
PlayerInfo[MAX_PLAYERS][pDuty] = 0;
            
PlayerInfo[MAX_PLAYERS][pLeader] = 0;
            if(!
IsValidSkin(PlayerInfo[MAX_PLAYERS][pModel])) {
                
PlayerInfo[MAX_PLAYERS][pModel] = CIV[random(sizeof(CIV))];
            }
            if(
PlayerInfo[MAX_PLAYERS][pDonateRank] < 3) for(new iToyIteriToyIter MAX_PLAYER_ATTACHED_OBJECTS; ++iToyIter) {
                for(new 
LoopRapistLoopRapist sizeof(HoldingObjectsCop); ++LoopRapist) {
                    if(
HoldingObjectsCop[LoopRapist][holdingmodelid] == PlayerToyInfo[MAX_PLAYERS][iToyIter][ptModelID]) {
                        
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptModelID] = 0;
                        
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptBone] = 0;
                        
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosX] = 0.0;
                        
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosY] = 0.0;
                        
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosZ] = 0.0;
                        
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosX] = 0.0;
                        
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosY] = 0.0;
                        
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosZ] = 0.0;
                    }
                }
            }
            new
                
szMessage[36 MAX_PLAYER_NAME];
            
format(szMessagesizeof(szMessage), "You have kicked %s from the faction."params);
            
SendClientMessageEx(playeridCOLOR_LIGHTBLUEszMessage);
            
OnPlayerOfflineSave(params);
        }
        else 
SendClientMessageEx(playeridCOLOR_WHITE"That player can not be uninvited by you.");
    }
    else 
SendClientMessageEx(playeridCOLOR_GRAD1"You are not authorized to use that command - only leaders can do this.");
    return 
1;

Reply
#2

You sure the command you posted above to uninvite 1 player works? You probably tested it with 1 players.... Otherwise it wouldn't.
Reply
#3

its work bro, but i want reset all factions

or this commands for all faction kick

PHP код:
CMD:fackick(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= || PlayerInfo[playerid][pFactionModerator] >= 1)
    {
        new 
string[128], giveplayerid;
        if(
sscanf(params"u"giveplayerid)) return SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /fackick [playerid]");


        if(
IsPlayerConnected(giveplayerid))
        {
            if(
PlayerInfo[giveplayerid][pMember] >= || PlayerInfo[giveplayerid][pLeader] >= 1)
            {
                
format(stringsizeof(string), "You have been faction-kicked, by %s."GetPlayerNameExplayerid ));
                
SendClientMessageEx(giveplayeridCOLOR_LIGHTBLUEstring);
                
PlayerInfo[giveplayerid][pTeam] = TEAM_GREEN;
                
gTeam[giveplayerid] = PlayerInfo[giveplayerid][pTeam];
                
PlayerInfo[giveplayerid][pMember] = 0;
                
PlayerInfo[giveplayerid][pRank] = 0;
                
PlayerInfo[giveplayerid][pChar] = 0;
                
PlayerInfo[giveplayerid][pDuty] = 0;
                
PlayerInfo[giveplayerid][pLeader] = 0;
                
PlayerInfo[giveplayerid][pDivision] = 0;
                if(!
IsValidSkin(GetPlayerSkin(giveplayerid)))
                {
                    new 
rand random(sizeof(CIV));
                    
SetPlayerSkin(giveplayerid,CIV[rand]);
                    
PlayerInfo[giveplayerid][pModel] = CIV[rand];
                }
                
player_remove_vip_toys(giveplayerid);
                
pTazer[giveplayerid] = 0;
                
SetPlayerToTeamColor(giveplayerid);
                
format(stringsizeof(string), "You have faction-kicked %s."GetPlayerNameEx(giveplayerid));
                
SendClientMessageEx(playeridCOLOR_WHITEstring);
            }
            else
            {
                
SendClientMessageEx(playeridCOLOR_WHITE"You can't kick someone from a faction if they're not a member.");
            }
        }
        else
        {
            
SendClientMessageEx(playeridCOLOR_GREY"Invalid player specified..");
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)