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] Equipar não diminui os materiais (https://forum.sa-mp.com/showthread.php?t=619798)

LuanGamer 22/10/2016 03:06 PM

Equipar não diminui os materiais
 
Boa tarde,
Seguinte percebi que os materiais não estão diminuindo, você até consegue ganhar materiais por controlar os territórios, mas ao equipar continua o mesmo numero de materiais, percebi isso ao chegar a 34kk de materiais, achei estranho e fiz o teste.
Alguém poderia me ajudar a consertar isso?

Obrigado pela atenção.

Dayvison_ 22/10/2016 03:09 PM

Re: Equipar não diminui os materiais
 
manda o código

LuanGamer 22/10/2016 03:35 PM

Re: Equipar não diminui os materiais
 
Opa então, o código abaixo não é simplesmente um /equipar(pois esse não funciona) mas acredito que é por ele que é usado quando você clica em equipar no infohq, e acredito que por ser um GivePlayerWeapon, ele não diminua nos materiais da org, segue código abaixo:

PHP Code:

CMD:equipar(playeridparams[])
    {
        new 
string[128];
        new 
tmpcar GetPlayerVehicleID(playerid);
        
GetPlayerName(playeridsendernameMAX_PLAYER_NAME);
          if(
IsAEnforcerCar(tmpcar)|| PlayerToPoint(2playerid,246.3115,121.0975,1003.2301) ||
          
PlayerToPoint(2playerid,262.0182,71.0734,1003.2422) ||
          
PlayerToPoint(2playerid,211.2608,185.8552,1003.0313) ||
          
PlayerToPoint(2playerid,230.0127,165.0615,1003.0234) ||
          
PlayerToPoint(2playerid,-1521.1884,462.9987,7.1875) ||
          
PlayerToPoint(2playerid,616.8616,-592.8971,17.2330) ||
          
PlayerToPoint(2playerid,359.1856,211.4973,1008.3828))
        {
            if(
PlayerInfo[playerid][pJailed] != 0)
            {
                
SendClientMessage(playerid,COLOR_GREY," Você não pode equipar na cadeia!");
                return 
true;
            }
            if((
PlayerInfo[playerid][pAdmin] && admtrampando[playerid]) || (PlayerInfo[playerid][pHelper] && helpertrampando[playerid]))
            return 
SendClientMessage(playeridCOLOR_GREY"Você precisa estar em modo jogo para equipar-se.");

            if(
InTaser[playerid] == true)
            {
                
SendClientMessage(playerid,COLOR_GREY," Você não pode equipar-se quando estiver com o taser em mãos!");
                   return 
true;
            }

            if(
gettime() < GetPVarInt(playerid"VarDano"))
                return 
SendClientMessage(playeridCOLOR_GRAD1," Você só poderá equipar 1 minuto após tomar dano de alguém !");

            if(
PlayerInfo[playerid][pLider] == || PlayerInfo[playerid][pLider] == ||
            
PlayerInfo[playerid][pLider] == 16 || PlayerInfo[playerid][pLider] == 11 ||
            
PlayerInfo[playerid][pLider] == 33|| PlayerInfo[playerid][pMembro] == ||
            
PlayerInfo[playerid][pMembro] == || PlayerInfo[playerid][pMembro] == 16 ||
            
PlayerInfo[playerid][pMembro] == 11 || PlayerInfo[playerid][pMembro] == 33 ||
            
GetPlayerOrg(playerid) == 35)
            {
                if(
PlayerInfo[playerid][pCargo] == || PlayerInfo[playerid][pCargo] == 444 || PlayerInfo[playerid][pCargo] == 555)
                {
                       
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                    
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                    
ResetPlayerWeapons(playerid);
                    
TempDropArmasBody[playerid] = 0;
                    
SetPlayerArmour(playerid100.0);
                       
SetPlayerHealth(playerid100.0);
                    
GivePlayerWeapon(playerid25140);
                    
GivePlayerWeapon(playerid24170);
                    
GivePlayerWeapon(playerid29510);
                    
GivePlayerWeapon(playerid31550);
                    
GivePlayerWeapon(playerid3480);
                    
GivePlayerWeapon(playerid1750);
                    
GivePlayerWeapon(playerid31);
                   }
                if(
PlayerInfo[playerid][pCargo] == 5)
                 {
                       
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                    
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                    
ResetPlayerWeapons(playerid);
                    
TempDropArmasBody[playerid] = 0;
                    
SetPlayerArmour(playerid100.0);
                    
SetPlayerHealth(playerid100.0);
                    
GivePlayerWeapon(playerid25120);
                    
GivePlayerWeapon(playerid24360);
                    
GivePlayerWeapon(playerid29490);
                    
GivePlayerWeapon(playerid31);
                    
GivePlayerWeapon(playerid31400);
                    
GivePlayerWeapon(playerid3450);
                    
GivePlayerWeapon(playerid1740);
                }
                if(
PlayerInfo[playerid][pCargo] == 4)
                 {
                       
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                    
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                    
ResetPlayerWeapons(playerid);
                    
TempDropArmasBody[playerid] = 0;
                    
SetPlayerArmour(playerid100.0);
                    
SetPlayerHealth(playerid100.0);
                    
GivePlayerWeapon(playerid25120);
                    
GivePlayerWeapon(playerid24360);
                    
GivePlayerWeapon(playerid29490);
                    
GivePlayerWeapon(playerid31);
                    
GivePlayerWeapon(playerid31400);
                    
GivePlayerWeapon(playerid3450);
                    
GivePlayerWeapon(playerid1740);
                }
                  if(
PlayerInfo[playerid][pCargo] == 3)
                {
                       
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                    
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                    
ResetPlayerWeapons(playerid);
                    
TempDropArmasBody[playerid] = 0;
                       
SetPlayerArmour(playerid100.0);
                       
SetPlayerHealth(playerid100.0);
                    
GivePlayerWeapon(playerid25190);
                    
GivePlayerWeapon(playerid24150);
                    
GivePlayerWeapon(playerid29450);
                    
GivePlayerWeapon(playerid31550);
                    
GivePlayerWeapon(playerid1730);
                    
GivePlayerWeapon(playerid3430);
                    
GivePlayerWeapon(playerid31);
                }
                 if(
PlayerInfo[playerid][pCargo] == 2)
                {
                       
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                       
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                       
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                    
ResetPlayerWeapons(playerid);
                    
TempDropArmasBody[playerid] = 0;
                      
SetPlayerArmour(playerid100.0);
                    
SetPlayerHealth(playerid100.0);
                    
GivePlayerWeapon(playerid2580);
                    
GivePlayerWeapon(playerid24150);
                    
GivePlayerWeapon(playerid31);
                    
GivePlayerWeapon(playerid29300);
                    
GivePlayerWeapon(playerid31300);
                    
GivePlayerWeapon(playerid1720);
                }
                 if(
PlayerInfo[playerid][pCargo] == 1)
                 {
                       
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                    
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                    
ResetPlayerWeapons(playerid);
                    
TempDropArmasBody[playerid] = 0;
                    
SetPlayerArmour(playerid100.0);
                    
SetPlayerHealth(playerid100.0);
                    
GivePlayerWeapon(playerid25190);
                    
GivePlayerWeapon(playerid24150);
                    
GivePlayerWeapon(playerid29450);
                    
GivePlayerWeapon(playerid31550);
                    
GivePlayerWeapon(playerid1730);
                    
GivePlayerWeapon(playerid31);
                }
               }
            if(
PlayerInfo[playerid][pLider] == 3)
            {
                
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                
ResetPlayerWeapons(playerid);
                
TempDropArmasBody[playerid] = 0;
                
SetPlayerArmour(playerid100.0);
                
SetPlayerHealth(playerid100.0);
                
GivePlayerWeapon(playerid25500);
                
GivePlayerWeapon(playerid24500);
                
GivePlayerWeapon(playerid31600);
                
GivePlayerWeapon(playerid29600);
                
GivePlayerWeapon(playerid1710);
                
GivePlayerWeapon(playerid34100);
                return 
true;
            }
            if(
PlayerInfo[playerid][pMembro] == 3)//Exército
               
{
                   
SetPlayerArmour(playerid100.0);
                
SetPlayerHealth(playerid100.0);
                
GivePlayerWeapon(playerid41);
                if(
PlayerInfo[playerid][pCargo] == 1)
                {
                    
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                    
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                    
ResetPlayerWeapons(playerid);
                    
TempDropArmasBody[playerid] = 0;
                    
GivePlayerWeapon(playerid2580);
                    
GivePlayerWeapon(playerid2480);
                    
GivePlayerWeapon(playerid31300);
                    
GivePlayerWeapon(playerid29300);
                    
GivePlayerWeapon(playerid1710);
                    return 
true;
                }
                   if(
PlayerInfo[playerid][pCargo] == 2)
                {
                       
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                    
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                    
ResetPlayerWeapons(playerid);
                    
TempDropArmasBody[playerid] = 0;
                    
GivePlayerWeapon(playerid2580);
                    
GivePlayerWeapon(playerid24150);
                    
GivePlayerWeapon(playerid29300);
                    
GivePlayerWeapon(playerid31400);
                    
GivePlayerWeapon(playerid1720);
                    return 
true;
                }
                  if(
PlayerInfo[playerid][pCargo] == 3)
                   {
                      
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                    
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                    
ResetPlayerWeapons(playerid);
                    
TempDropArmasBody[playerid] = 0;
                    
GivePlayerWeapon(playerid25190);
                    
GivePlayerWeapon(playerid24150);
                    
GivePlayerWeapon(playerid29450);
                    
GivePlayerWeapon(playerid31550);
                    
GivePlayerWeapon(playerid1730);
                    
GivePlayerWeapon(playerid3425);
                    return 
true;
                }
                if(
PlayerInfo[playerid][pCargo] == 4)
                {
                    
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                    
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                    
ResetPlayerWeapons(playerid);
                    
TempDropArmasBody[playerid] = 0;
                    
GivePlayerWeapon(playerid25120);
                    
GivePlayerWeapon(playerid24360);
                    
GivePlayerWeapon(playerid29490);
                    
GivePlayerWeapon(playerid31400);
                    
GivePlayerWeapon(playerid1740);
                    
GivePlayerWeapon(playerid3450);
                    return 
true;
                }
                if(
PlayerInfo[playerid][pCargo] == || PlayerInfo[playerid][pCargo] == 444 || PlayerInfo[playerid][pCargo] == 555)
                {
                    
format(stringsizeof(string), "* %s se equipou."PlayerName(playerid));
                    
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                    
ResetPlayerWeapons(playerid);
                    
TempDropArmasBody[playerid] = 0;
                    
GivePlayerWeapon(playerid25140);
                    
GivePlayerWeapon(playerid24170);
                    
GivePlayerWeapon(playerid29510);
                    
GivePlayerWeapon(playerid31550);
                    
GivePlayerWeapon(playerid1750);
                    
GivePlayerWeapon(playerid34100);
                    return 
true;
                }
            }
        }
        if(
PlayerInfo[playerid][pMembro] == 20 || PlayerInfo[playerid][pLider] == 20)//Bombeiros
         
{
             if(
PlayerToPoint(2.0playerid,1496.9415,-1509.9282,14.1453))
            {
                 if(
PlayerInfo[playerid][pCargo] >= 1)
                      {
                            
format(stringsizeof(string), "[BOMBEIRO]: %s se equipou."sendername);
                            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*** Você pegou seus equipamentos de acordo com o seu cargo!");
                            
ResetPlayerWeapons(playerid);
                            
TempDropArmasBody[playerid] = 0;
                            
SetPlayerArmour(playerid100.0);
                               
SetPlayerHealth(playerid100.0);
                            
GivePlayerWeapon(playerid425000);
                            
GivePlayerWeapon(playerid91);
                            return 
1;
                    }
            }
        }
         return 
true;
    } 


LuanGamer 22/10/2016 03:42 PM

Re: Equipar não diminui os materiais
 
Também tem esse, sendo que maconha não dá ao equipar não:
PHP Code:

if(OrgsGang(playerid))
                    {
                               new 
darmaconha CofreOrg[org][dMaconha];
                             new 
maconha CofreOrg[org][Maconha];
                              
ResetPlayerWeapons(playerid);
                              
TempDropArmasBody[playerid] = 0;
                              if(
CofreOrg[org][Maconha] > darmaconha && IsAMember(playerid))
                                {
                                    
format(stringsizeof(string), "Sua HQ te deu %d de Maconha"darmaconha);
                                    
SendClientMessage(playeridCOLOR_YELLOW,string);
                                    
CofreOrg[org][Maconha] = maconha-darmaconha;
                                    
PlayerInfo[playerid][pDrogas] += darmaconha;
                                }
                                else
                                {
                                }
                              if(
CofreOrg[PlayerInfo[playerid][pMembro]][Vip] != || CofreOrg[PlayerInfo[playerid][pLider]][Vip] != 0)
                              {
                                  
SendClientMessage(playeridCOLOR_LIGHTBLUE"*Voce Pegou os Equipamentos VIP de Sua Org.");
                                 
format(stringsizeof(string), "* %s pega seus equipamentos ORG-VIP."sendername);
                                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                
SetPlayerHealth(playerid100.0);
                                  
SetPlayerArmour(playerid100.0);
                                  
GivePlayerWeapon(playerid185);
                                
GivePlayerWeapon(playerid24500);
                                
GivePlayerWeapon(playerid25500);
                                
GivePlayerWeapon(playerid29500);
                                
GivePlayerWeapon(playerid31500);
                                
GivePlayerWeapon(playerid34500);
                                
PlayerInfo[playerid][pExplosivos] = 5;
                                return 
1;
                              }
                              else
                              {
                                  
SendClientMessage(playeridCOLOR_LIGHTBLUE"*Voce Pegou os Equipamentos Próprios Para o seu Cargo.");
                                if (
PlayerInfo[playerid][pCargo] == 1)
                                {
                                       
format(stringsizeof(string), "* %s pega seus equipamentos."sendername);
                                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                    
SetPlayerHealth(playerid100.0);
                                    
SetPlayerArmour(playerid100.0);
                                    
GivePlayerWeapon(playerid24100);
                                    
GivePlayerWeapon(playerid2550);
                                    
GivePlayerWeapon(playerid2980);
                                    
GivePlayerWeapon(playerid3150);
                                    return 
1;
                                }
                                if (
PlayerInfo[playerid][pCargo] == 2)
                                {
                                       
format(stringsizeof(string), "* %s pega seus equipamentos."sendername);
                                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                    
SetPlayerHealth(playerid100.0);
                                    
SetPlayerArmour(playerid100.0);
                                    
GivePlayerWeapon(playerid24150);
                                    
GivePlayerWeapon(playerid2570);
                                    
GivePlayerWeapon(playerid29120);
                                    
GivePlayerWeapon(playerid31100);
                                    return 
1;
                                }
                                 if (
PlayerInfo[playerid][pCargo] == 3)
                                {
                                       
format(stringsizeof(string), "* %s pega seus equipamentos."sendername);
                                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                    
SetPlayerHealth(playerid100.0);
                                    
SetPlayerArmour(playerid100.0);
                                    
GivePlayerWeapon(playerid183);
                                    
GivePlayerWeapon(playerid24170);
                                    
GivePlayerWeapon(playerid25100);
                                    
GivePlayerWeapon(playerid29150);
                                    
GivePlayerWeapon(playerid31150);
                                    return 
1;
                                }
                                  if (
PlayerInfo[playerid][pCargo] == 4)
                                {
                                       
format(stringsizeof(string), "* %s pega seus equipamentos."sendername);
                                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                    
SetPlayerHealth(playerid100.0);
                                    
SetPlayerArmour(playerid100.0);
                                    
GivePlayerWeapon(playerid184);
                                    
GivePlayerWeapon(playerid24200);
                                    
GivePlayerWeapon(playerid25150);
                                    
GivePlayerWeapon(playerid29200);
                                    
GivePlayerWeapon(playerid31200);
                                    return 
1;
                                }
                                 if (
PlayerInfo[playerid][pCargo] == || PlayerInfo[playerid][pCargo] == 444 || PlayerInfo[playerid][pCargo] == 555)
                                {
                                       
format(stringsizeof(string), "* %s pega seus equipamentos."sendername);
                                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                    
SetPlayerHealth(playerid100.0);
                                    
SetPlayerArmour(playerid100.0);
                                    
GivePlayerWeapon(playerid186);
                                    
GivePlayerWeapon(playerid24250);
                                    
GivePlayerWeapon(playerid25200);
                                    
GivePlayerWeapon(playerid29250);
                                    
GivePlayerWeapon(playerid31250);
                                    return 
1;
                                }
                                if (
PlayerInfo[playerid][pCargo] == 6)
                                {
                                       
format(stringsizeof(string), "* Líder %s pega seus equipamentos."sendername);
                                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                      
SetPlayerHealth(playerid100.0);
                                    
SetPlayerArmour(playerid100.0);
                                    
GivePlayerWeapon(playerid188);
                                    
GivePlayerWeapon(playerid24250);
                                    
GivePlayerWeapon(playerid25250);
                                    
GivePlayerWeapon(playerid29300);
                                    
GivePlayerWeapon(playerid31300);
                                    return 
1;
                                }
                            }
                        } 



All times are GMT. The time now is 03:12 AM.

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