SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 11/06/2020, 08:04 PM   #1
SkolPlay
Big Clucker
 
Join Date: Aug 2016
Posts: 193
Reputation: 0
Default 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.
SkolPlay is offline   Reply With Quote
Old 11/06/2020, 08:35 PM   #2
ThiagoiHarDz
Banned
 
Join Date: May 2020
Location: Macarani-BA
Posts: 102
Reputation: 0
Default 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 !");
ThiagoiHarDz is offline   Reply With Quote
Old 11/06/2020, 08:47 PM   #3
SkolPlay
Big Clucker
 
Join Date: Aug 2016
Posts: 193
Reputation: 0
Default Re: Dominando gz pelo jetpack

Quote:
Originally Posted by ThiagoiHarDz View Post
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
SkolPlay is offline   Reply With Quote
Old 11/06/2020, 08:49 PM   #4
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,556
Reputation: 332
Default Re: Dominando gz pelo jetpack

= é pra atribuir e == é pra comparar.
__________________

Precisando de algum sistema? Chame!

ipsLuan is offline   Reply With Quote
Old 11/06/2020, 09:10 PM   #5
Khivory
Huge Clucker
 
Khivory's Avatar
 
Join Date: Feb 2020
Posts: 320
Reputation: 17
Default Re: Dominando gz pelo jetpack

PHP Code:
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USE_JETPACK
Melhor que fazer jogo de adivinhação
Khivory is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bug jetpack madalin912 Scripting Help 26 06/03/2015 06:59 PM
[FilterScript] RCON Jetpack - /jetpack EvanA Filterscripts 17 19/10/2013 08:16 PM
[Ajuda] Gang War - Dominando território brunoronning Português/Portuguese 5 04/05/2013 07:09 AM
/jetpack help WiseRice Scripting Help 8 17/03/2013 08:38 AM
[Ajuda] BUG TERRITÓRIO DOMINANDO PRA SEMPRE Alien_Halls Português/Portuguese 9 16/02/2013 04:23 PM


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


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