[Ajuda] Bloquear /convidar em guerras
#1

Como bloquear o comando /convidar na hora de guerra?

Cуdigo do /convidar:

PHP код:
if(strcmp(cmd"/convidar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /convidar [playerid/Parte-do-Nick]");
                return 
true;
            }
            new 
para1;
            
para1 ReturnUser(tmp);
            if (
PlayerInfo[playerid][pLider] >= || PlayerInfo[playerid][pCargo] > 90)
            {
                new 
lolz GetPlayerOrg(playerid);
                if(
TemVaga(lolz) == 0)
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Nгo hб mais vagas na lista use /limparvaga primeiro.");
                    return 
true;
                }
                if(
IsPlayerConnected(para1))
                {
                    if(
PlayerInfo[para1][pMembro] != || PlayerInfo[para1][pLider] != 0)
                    {
                        
SendClientMessage(playeridCOLOR_GREY"Este player jб participa de Org/Gang/Mafia.");
                        return 
true;
                    }
                    if(
para1 != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(para1giveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
format(stringsizeof(string), "* Vocк convidou %s para sua organizaзгo: %s."giveplayer,NomeORG(playerid));
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                        new 
convitestring[128];
                        
format(convitestring,sizeof(convitestring), "O Lider dos: %s\n\nEsta convidando voce para entrar para a organizaзгo\n\nDeseja entrar para org?",NomeORG(playerid));
                        
ShowPlayerDialog(para1,642,DIALOG_STYLE_MSGBOX,"Convite",convitestring,"Aceitar","Recusar");
                        
InviteOffer[para1] = playerid;
                        
InviteJob[para1] = lolz;
                    }
                }
//not connected
            
}
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"   Somente lнderes podem usar este comando !");
            }
        }
        return 
true;
    } 
Comando de Guerra:

PHP код:
if(strcmp(cmd"/guerra"true) == 0)
    {
        if(
PlayerInfo[playerid][pJailed] != 0)
        {
            
SendClientMessage(playerid,CINZA," Vocк nгo pode criar guerra na cadeia!");
            return 
true;
        }
          if(
TendoGuerra >= 1)
        {
            
SendClientMessage(playeridCINZA"   Jб estб tendo uma guerra!");
            return 
true;
        }
        new 
Float:x,Float:y,Float:z;
        if(
PlayerInfo[playerid][pMembro] == || PlayerInfo[playerid][pLider] == 3)// EXE
          
{
            
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "%s e o Exйrcito iniciaram uma Guerra. Evitem se proximar da Бrea da Guerra!",playername);
            
SendClientMessageToAll(COLOR_EXEstring);
            
GetPlayerPos(playerid,x,y,z);
            
Territorio[MinX] = x-120;
            
Territorio[MinY] = y-120;
            
Territorio[MaxX] = x+120;
            
Territorio[MaxY] = y+120;
            
Territorio[exemortos] = 0;
            
Territorio[talmortos] = 0;
            
Territorio[almortos] = 0;
            
Territorio[GImortos] = 0;
            
GuerraMinX x-120;
            
GuerraMinY y-120;
            
GuerraMaxX x+120;
            
GuerraMaxY y+120;
            
GZGuerra GangZoneCreate(x-120,y-120,x+120,y+120);
            
GangZoneShowForAll(GZGuerra,COLORGZ_EXE);
            
BPHInfo[playerid][InicioGuerra] = 1;
            
TendoGuerra 1;
               
TempoGuerra SetTimerEx("GuerraTerrorista"1800000"i"playerid);
            return 
true;
        }
        if(
PlayerInfo[playerid][pMembro] == || PlayerInfo[playerid][pLider] == 6)// GIA
          
{
            
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "%s e o GIA iniciaram uma Guerra.Evitem a бrea!",playername);
            
SendClientMessageToAll(COR_GIAstring);
            
GetPlayerPos(playerid,x,y,z);
            
Territorio[MinX] = x-120;
            
Territorio[MinY] = y-120;
            
Territorio[MaxX] = x+120;
            
Territorio[MaxY] = y+120;
            
Territorio[exemortos] = 0;
            
Territorio[talmortos] = 0;
            
Territorio[almortos] = 0;
            
Territorio[GImortos] = 0;
            
GuerraMinX x-120;
            
GuerraMinY y-120;
            
GuerraMaxX x+120;
            
GuerraMaxY y+120;
            
GZGuerra GangZoneCreate(x-120,y-120,x+120,y+120);
            
GangZoneShowForAll(GZGuerra,COLORGZ_GIA);
            
BPHInfo[playerid][InicioGuerra] = 1;
            
TendoGuerra 1;
               
TempoGuerra SetTimerEx("GuerraTerrorista"1800000"i"playerid);
            return 
true;
        }
        if(
PlayerInfo[playerid][pMembro] == 15 || PlayerInfo[playerid][pLider] == 15)// GI
          
{
            
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "%s e a FARC iniciaram uma Guerra.Evitem a бrea!",playername);
            
SendClientMessageToAll(COR_FARCstring);
            
GetPlayerPos(playerid,x,y,z);
            
Territorio[MinX] = x-120;
            
Territorio[MinY] = y-120;
            
Territorio[MaxX] = x+120;
            
Territorio[MaxY] = y+120;
            
Territorio[exemortos] = 0;
            
Territorio[talmortos] = 0;
            
Territorio[almortos] = 0;
            
Territorio[GImortos] = 0;
            
GuerraMinX x-120;
            
GuerraMinY y-120;
            
GuerraMaxX x+120;
            
GuerraMaxY y+120;
            
GZGuerra GangZoneCreate(x-120,y-120,x+120,y+120);
            
GangZoneShowForAll(GZGuerra,COLORGZ_ALCAIDA);
            
BPHInfo[playerid][InicioGuerra] = 1;
            
TendoGuerra 1;
               
TempoGuerra SetTimerEx("GuerraTerrorista"1800000"i"playerid);
            return 
true;
        }
          if(
PlayerInfo[playerid][pMembro] == 23 || PlayerInfo[playerid][pLider] == 23)// F    ARC
          
{
            
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "%s e a Guerrilheiros Israelitas iniciaram uma Guerra.Evitem a бrea!",playername);
            
SendClientMessageToAll(COR_GIstring);
            
GetPlayerPos(playerid,x,y,z);
            
Territorio[MinX] = x-120;
            
Territorio[MinY] = y-120;
            
Territorio[MaxX] = x+120;
            
Territorio[MaxY] = y+120;
            
Territorio[exemortos] = 0;
            
Territorio[talmortos] = 0;
            
Territorio[almortos] = 0;
            
Territorio[GImortos] = 0;
            
GuerraMinX x-120;
            
GuerraMinY y-120;
            
GuerraMaxX x+120;
            
GuerraMaxY y+120;
            
GZGuerra GangZoneCreate(x-120,y-120,x+120,y+120);
            
GangZoneShowForAll(GZGuerra,COLORGZ_GI);
            
BPHInfo[playerid][InicioGuerra] = 1;
            
TendoGuerra 1;
               
TempoGuerra SetTimerEx("GuerraTerrorista"1800000"i"playerid);
            return 
true;
        }
        return 
true;
    } 
Reply
#2

pawn Код:
if(strcmp(cmd, "/convidar", true) == 0)
    {
        if(TendoGuerra == 1) return SendClientMessage(playerid, 0xFF0000AA, "Estб tendo uma guerra, e vocк nгo pode convidar ninguйm."); // AQUI
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /convidar [playerid/Parte-do-Nick]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            if (PlayerInfo[playerid][pLider] >= 1 || PlayerInfo[playerid][pCargo] > 90)
            {
                new lolz = GetPlayerOrg(playerid);
                if(TemVaga(lolz) == 0)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparvaga primeiro.");
                    return true;
                }
                if(IsPlayerConnected(para1))
                {
                    if(PlayerInfo[para1][pMembro] != 0 || PlayerInfo[para1][pLider] != 0)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "Este player jб participa de Org/Gang/Mafia.");
                        return true;
                    }
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* Vocк convidou %s para sua organizaзгo: %s.", giveplayer,NomeORG(playerid));
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

                        new convitestring[128];
                        format(convitestring,sizeof(convitestring), "O Lider dos: %s\n\nEsta convidando voce para entrar para a organizaзгo\n\nDeseja entrar para org?",NomeORG(playerid));
                        ShowPlayerDialog(para1,642,DIALOG_STYLE_MSGBOX,"Convite",convitestring,"Aceitar","Recusar");

                        InviteOffer[para1] = playerid;
                        InviteJob[para1] = lolz;
                    }
                }//not connected
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Somente lнderes podem usar este comando !");
            }
        }
        return true;
    }
Reply
#3

Certinho, valeu! ;P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)