SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Português/Portuguese (https://forum.sa-mp.com/forumdisplay.php?f=34)
-   -   [Ajuda] Dominando gz pelo jetpack (https://forum.sa-mp.com/showthread.php?t=676520)

SkolPlay 11/06/2020 08:04 PM

Dominando gz pelo jetpack
 
Eu estou com um sistema de dominar gz, porém to tentando colocar pra proibir a dominação utilizando o jetpack.

PHP Code:

public TempoDominarBase()
{
   for(new 
0TOTALBASES++)
            {
                if((
>= CoordenadasBases[B][0]) && (>= CoordenadasBases[B][1]) && (<= CoordenadasBases[B][2]) && (<= CoordenadasBases[B][3]))
                {
                    
AchouX[I] = 1;
                    
BaseXxX[I] = -1;
                    
format(Tsizeof(T), "~g~~h~~h~~h~Base ~w~~h~ID %d ~b~~h~~h~/InfoBase ~y~- ~r~~h~~h~GC dono: ~w~%s"Bdini_Get(BasesFile(B),"Dono"));
                    
TextDrawSetString(TextdrawBase1[I], T);
                    
TextDrawShowForPlayer(ITextdrawBase1[I]);
                    if(
PrintON[I] == 1TextDrawHideForPlayer(ITextdrawBase1[I]);
                    if((
BaseDono[B] != GetGCMember(I)) && (GetGCMember(I) != -1) && (IsPlayerInAnyVehicle(I)))
                    {
                        
TempoBase[I] = TempoDefinido;
                        
SendClientMessage(I0xFF5E35FF"| ERRO | Você não pode dominar uma base dentro de um veículo!");
                        if(
DominandoBase[I] == 1)
                           {
                               
SaiuBase(IB);
                        }
                    }
                    else if((
BaseDono[B] != GetGCMember(I)) && (GetGCMember(I) != -1) && (BaseSendoAtacada[B] != I) && (BaseSendoAtacada[B] != -1))
                    {
                        
TempoBase[I] = TempoDefinido;
                        
SendClientMessage(I0xFF5E35FF"| ERRO | Essa base já está sendo atacada");
                        if(
DominandoBase[I] == 1)
                           {
                               
SaiuBase(IB);
                        }
                    }
                    else if((
BaseDono[B] != GetGCMember(I)) && (GetGCMember(I) != -1))
                    {
                        if(
BaseSendoAtacada[B] == -1)
                        {
                            
BaseSendoAtacada[B] = I;
                        }
                        if(
BaseSendoAtacada[B] == I)
                        {
                            if(
PiscaBaseX[B] == 1)
                            {
                                
PiscaBaseX[B] = 0;
                                foreach (
PlayerP)
                                {
                                    if(
IsPlayerConnected(P))
                                    {
                                        if(
dini_Int(GCsFile(GetGCMember(I)),"CorMapa") != 0)
                                        {
                                            
ChangeColorOfGZBase(PBCoresGCs[dini_Int(GCsFile(GetGCMember(I)),"CorMapa") - 1]);
                                        }
                                        else
                                        {
                                            
ChangeColorOfGZBase(PB0xFFFFFFAA);
                                        }
                                        if(
IsValidOwnerBase(B) == 1ChangeMapIconOfBase(PBdini_Int(GCsFile(GetGCMember(I)),"Icone"));
                                        
//ChangeColorOfGZBase(P, B, GetPlayerColor(I));
                                    
}
                                }
                            }
                            else if(
PiscaBaseX[B] == 0)
                            {
                                
PiscaBaseX[B] = 1;
                                foreach (
PlayerP)
                                {
                                    if(
IsPlayerConnected(P))
                                    {
                                        
RemoveGZOfBase(PB);
                                        
AddGZOfBase(PB);
                                        if(
IsValidOwnerBase(B) == 1ChangeMapIconOfBase(PBdini_Int(GCsFile(BaseDono[B]),"Icone"));
                                    }
                                }
                            }
                            if(
EnviouMensagem[I] >= 5)
                            {
                                
format(Tsizeof(T), "| INFO | Atacando Base ID %d dos %s! [%d segundos]"Bdini_Get(BasesFile(B),"Dono"), TempoBase[I]);
                                 
SendClientMessage(ICOR_ORKUTT);
                                
EnviouMensagem[I] = 0;
                            }
                            else
                            {
                                 
EnviouMensagem[I] ++;
                            }
                            if(
IsValidOwnerBase(B) == 1)
                            {
                                if(
TempoBase[I] > 1format(Tsizeof(T), "~r~%d ~w~s"TempoBase[I]);
                                else 
format(Tsizeof(T), "~r~%d ~w~s"TempoBase[I]);
                                
TextDrawBase2SetString(BaseDono[B], T);
                                
TextDrawBase2ShowForMembersOfGC(BaseDono[B]);
                                if(
VBase[B] >= 5)
                                {
                                    
format(Tsizeof(T), "| INFO | Base ID %d sendo atacada pelos %s! [%d segundos]"Bdini_Get(GCsFile(GetGCMember(I)),"Nome"), TempoBase[I]);
                                    
MessageToMembersOfGC(BaseDono[B], COR_ORKUTT);
                                    
VBase[B] = 0;
                                }
                                else
                                {
                                    
VBase[B] ++;
                                }
                            }
                            
BaseXxX[I] = B;
                            
DominandoBase[I] = 1;
                            
TempoBase[I] --;
                            if(
TempoBase[I] > 1format(Tsizeof(T), "~y~%d ~w~s"TempoBase[I]);
                            else 
format(Tsizeof(T), "~y~%d ~w~s"TempoBase[I]);
                            
TextDrawSetString(TextdrawBase2[I], T);
                            
TextDrawShowForPlayer(ITextdrawBase2[I]);
                            if(
PrintON[I] == 1TextDrawHideForPlayer(ITextdrawBase2[I]);
                            if(
TempoBase[I] == 0)
                            {
                                if(
IsValidOwnerBase(B) == 1TextDrawBase2HideForMembersOfGC(BaseDono[B]);
                                
BaseSendoAtacada[B] = -1;
                                
TempoBase[I] = TempoDefinido;
                                if(
IsValidOwnerBase(B) == 1format(Tsizeof(T), "| INFO | A Base ID %d dos %s foi dominada pelos %s!"Bdini_Get(GCsFile(BaseDono[B]),"Nome"), dini_Get(GCsFile(GetGCMember(I)),"Nome"));
                                else 
format(Tsizeof(T), "| INFO | A Base ID %d dos Nenhum foi dominada pelos %s!",Bdini_Get(GCsFile(GetGCMember(I)),"Nome"));
                                
MessageToAllMembersOfGCs(COR_ORKUTT);
                                if(
IsValidOwnerBase(B) == 1TextDrawBase2HideForMembersOfGC(BaseDono[B]);
                                
TextDrawHideForPlayer(ITextdrawBase2[I]);
                                new 
ValorXB[128];
                                
format(ValorXBsizeof(ValorXB), "%d"dini_Int(BasesFile(B), "Dinheiro"));
                                
ResetarConfiguracoesBase(B);
                                
format(Tsizeof(T), "%s"dini_Get(GCsFile(GetGCMember(I)),"Nome"));
                                
dini_Set(BasesFile(B), "Dono"T);
                                
dini_Set(BasesFile(B), "Situacao""1");
                                
dini_Set(BasesFile(B), "Dinheiro"ValorXB);
                                
BaseDono[B] = GetGCMember(I);
                                
format(Tsizeof(T), "%d"GetGCMember(I));
                                
dini_Set(BasesFile(B), "IDx"T);
                                
format(Tsizeof(T), "| INFO | Você dominou a Base ID %d!"B);
                                
SendClientMessage(ICOR_ORKUTT);
                                
DominandoBase[I] = 0;
                                
/*for(new Mx = 0; Mx < MAX_MEMBERS; Mx ++)
                                {
                                    new Tx[128];
                                    format(Tx, sizeof(Tx), "Membro%d", (Mx));
                                    foreach(Player, Xx)
                                    {
                                        if(!strcmp(Nomex(Xx), dini_Get(GCsFile(GetGCMember(I)), Tx), true))
                                        {
                                            Banco[Xx] += 300;
                                            new Sx[128];
                                            format(Sx, sizeof(Sx), "| INFO | Você ganhou R$ 300 por ser membro da GC que conquistou a Base ID %d!", dini_Get(GCsFile(GetGCMember(I))));
                                            SendClientMessage(Xx, COR_ORKUT, Sx);
                                        }
                                    }
                                }*/
                                
foreach (PlayerP)
                                {
                                    if(
IsPlayerConnected(P))
                                    {
                                        if(
dini_Int(GCsFile(GetGCMember(I)),"CorMapa") != 0)
                                        {
                                            
ChangeColorOfGZBase(PBCoresGCs[dini_Int(GCsFile(GetGCMember(I)),"CorMapa") - 1]);
                                        }
                                        else
                                        {
                                            
ChangeColorOfGZBase(PB0xFFFFFFAA);
                                        }
                                        if(
IsValidOwnerBase(B) == 1ChangeMapIconOfBase(PBdini_Int(GCsFile(GetGCMember(I)),"Icone"));
                                        
//ChangeColorOfGZBase(P, B, GetPlayerColor(I));
                                    
}
                                }
if(
AchouX[I] == 0)
            {
                if(
DominandoBase[I] == 1)
                {
                    
SaiuBase(IBaseXxX[I]);
}
                
EnviouMensagem[I] = 5;
                if(
MsgCartaoAtivada[I] == 0)TextDrawHideForPlayer(ITextdrawBase1[I]);
                
TextDrawHideForPlayer(ITextdrawBase2[I]);
                
TempoBase[I] = TempoDefinido;
                
BaseXxX[I] = -1;
            }
        }
    }
    return 
1;


Já tentei das seguintes formas, mas não funcionaram:
pawn Code:
if((Jetpack[I] = 0))
{
  SendClientMessage(I, 0xFF5E35FF, "| ERRO | Você não pode dominar uma base dentro de um veículo!");
}

if((Jetpack[I] = -1))
{
  SendClientMessage(I, 0xFF5E35FF, "| ERRO | Você não pode dominar uma base dentro de um veículo!");
}

if((Jetpack[I] = 1))
{
  SendClientMessage(I, 0xFF5E35FF, "| ERRO | Você não pode dominar uma base dentro de um veículo!");
}
if((BaseDono[B] != GetGCMember(I)) && (GetGCMember(I) != -1) && (Jetpack(I)))
                    {
                        TempoBase[I] = TempoDefinido;
                        SendClientMessage(I, 0xFF5E35FF, "| ERRO | Você não pode dominar uma base dentro de um veículo!");
                        if(DominandoBase[I] == 1)
                        {
                            SaiuBase(I, B);
                        }
                    }
Tentei mais formas, porém não vou incluir pra não ficar muito extenso o topico.

ThiagoiHarDz 11/06/2020 08:35 PM

Re: Dominando gz pelo jetpack
 
Tente adcionar isso aki

Code:

if(GetPlayerSpecialAction(playerid) == 2) return SendClientMessage(playerid,-1,"Você não pode dominar um  territorio em um veiculo !");

SkolPlay 11/06/2020 08:47 PM

Re: Dominando gz pelo jetpack
 
Quote:

Originally Posted by ThiagoiHarDz (Post 4150852)
Tente adcionar isso aki

Code:

if(GetPlayerSpecialAction(playerid) == 2) return SendClientMessage(playerid,-1,"Você não pode dominar um  territorio em um veiculo !");

Funcionou garotinho, brigadão. +REP

ipsLuan 11/06/2020 08:49 PM

Re: Dominando gz pelo jetpack
 
= é pra atribuir e == é pra comparar.

Khivory 11/06/2020 09:10 PM

Re: Dominando gz pelo jetpack
 
PHP Code:

if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USE_JETPACK

Melhor que fazer jogo de adivinhação


All times are GMT. The time now is 08:54 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.