[Ajuda] Compra Armas Bugado
#1

Tipo digito /comprararmas ai vou escolher a arma que eu quero й vem um carro vou mostra meu dialog

PHP код:
if (strcmp("/comprararmas"cmdtexttrue10) == 0)
    {
        
ShowPlayerDialog(playeridDIALOG_COMPRARARMASDIALOG_STYLE_TABLIST_HEADERS"Escolha a Arma Desejada","Armas\tValor\nM4-A1\t$30.000\nMP5\t$25.000\nAK-47\t$50.000\nDeagle\t$15.000","Comprar""Cancelar");
           return 
1;
       } 
PHP код:
if(dialogid == DIALOG_COMPRARARMAS)
    {
        if(!
response) return SCM(playeridVermelho,"[ERRO] Compra Cancelada.");
        {
             if(
listitem == 0)
            {
               if(
Player[playerid][pPresoADM] == || Player[playerid][pPresoSF] == || Player[playerid][pPresoLV] == || Player[playerid][pPresoLS] == || Player[playerid][InHospital] == true || Player[playerid][InHospital] == true || Player[playerid][InDM] == true)
                return 
SCM(playeridCOR_ERRO"[ERRO] Vocк nгo fazer isso!");
              if(
GetPlayerMoney(playerid) < 30000) return SCM(playerid,Vermelho,"[ERRO] Vocк nгo tem dinheiro para comprar esta arma.");
            {
                    
GivePlayerMoney(playerid,-30000);
                    
SCM(playerid,COR_LIGHTBLUE,"Vocк comprou uma M4");
                    
GivePlayerWeapon(playerid,31,3000000);
                }
            }
            if(
listitem == 1)
            {
                if(
GetPlayerMoney(playerid) < 25000) return SCM(playeridVermelho,"[ERRO] Vocк nгo tem dinheiro para comprar estб arma.");
                {
                    
GivePlayerMoney(playerid,-25000);
                    
SCM(playerid,COR_LIGHTBLUE,"Vocк comprou uma MP5");
                    
GivePlayerWeapon(playerid,29,3000000);
                }
            }
            if(
listitem == 2)
            {
                if(
GetPlayerMoney(playerid) < 30000) return SCM(playeridVermelho,"[ERRO] Vocк nгo tem dinheiro para comprar estб arma.");
                {
                       
GivePlayerMoney(playerid,-50000);
                    
SCM(playerid,COR_LIGHTBLUE,"Vocк comprou uma AK-47");
                    
GivePlayerWeapon(playerid,30,3000000);
                }
            }
              if(
listitem == 3)
            {
                if(
GetPlayerMoney(playerid) < 15000) return SCM(playeridVermelho,"[ERRO] Vocк nгo tem dinheiro para comprar estб arma.");
                {
                       
GivePlayerMoney(playerid,-15000);
                    
SCM(playerid,COR_LIGHTBLUE,"Vocк comprou uma Desert Eagle");
                    
GivePlayerWeapon(playerid,24,3000000);
                }
            }
        }
        return 
1;
    } 
Tб aparecendo o veiculo olha o code do veiculo que aparece
PHP код:
if(newstate == PLAYER_STATE_DRIVER)
    {
        if(
VeiculosHelper(GetPlayerVehicleID(playerid)))
        {
             if(
Player[playerid][pHelper] < 1)
            {
                new 
Float:Pos[3];
                
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
                
SetPlayerPos(playeridPos[0], Pos[1], Pos[2]+1);
                   
SCM(playeridCOR_ERRO"[ERRO] Veнculo exclusivo para Helpers!");
            }
        }
     } 
Reply
#2

Vo te passar o meu sistema de comprar armas aki.
Reply
#3

verifique se o ID de DIALOG_COMPRARARMAS nгo conhecide com o ID da dialog de veiculos
Reply
#4

Ta ae:

PasteBin: https://pastebin.com/CYymzqES
Reply
#5

#define MenuAmmu ''Define aki um numero que n esteja sendo usado''.

Exemplo:

#define MenuAmmu 4321

* OBS: Mude os Preзos das armas, o preзo das minhas sгo baixas

:v
Reply
#6

Verifique se nгo existe outra dialog com o mesmo nъmero definido.
Reply
#7

Quote:
Originally Posted by SpikeCompiler
Посмотреть сообщение
Verifique se nгo existe outra dialog com o mesmo nъmero definido.
PHP код:
// ~ ~ ~> Dialogs
#define MAX_GZS                                                                 16
#define MAX_FACCOES                                                              18
#define GM_NAME                                                        "Version"
#define GM_VERSAO                                                          "3.0"
#define SITE                                              "www.equipegb.com/fуrum"
#define RELOGIO_ANO                                                            2018
#define EVENTO                                                                 1
#define DIALOG_REGISTRO                                                        2
#define DIALOG_LOGIN                                                           3
#define DIALOG_FAVELAS                                                         4
#define FAVELAS                                                                  5
#define DIALOG_CONFIRMARCASH                                                   6
#define DIALOG_CREDITOS                                                        7
#define DIALOG_MACONHA                                                         8
#define DIALOG_COCAINA                                                         9
#define DIALOG_BALINHA                                                        10
#define DIALOG_LANCA                                                          11
#define HQ                                                                       12
#define LIMPA_FICHA                                                           13
#define DIALOG_FOGOS                                                          14
#define DIALOG_VENDERFOGOS                                                    15
#define DIALOG_TOCAR                                                          16
#define DIALOG_CARROS                                                           17
#define DIALOG_MOTOSMTX                                                       18
#define DIALOG_COMPRARARMAS                                                   19
#define DIALOG_HQ                                                             20
#define DIALOG_GPS                                                            21
#define DIALOG_GPS1                                                            22
#define DIALOG_GPS2                                                            23
#define DIALOG_GPS3                                                            28
#define DIALOG_EN                                                             29
#define DIALOG_EMPREGOS                                                        30
#define DIALOG_VEH                                                              31
#define DIALOG_BEBIDAS                                                          32
#define DIALOG_MOCHILA                                                           33
#define DIALOG_ARMAS                                                           34
#define DIALOG_DROGAS                                                          35
#define DIALOG_CASH                                                                36
#define DIALOG_MUDARNICK                                                      37
#define DIALOG_MUDARSENHA                                                     38
#define DIALOG_MENUCONTA                                                      39
// ~ ~ ~> Definiзхes
#define Kick(%0)                        SetTimerEx("Kicka", 100, false, "i", %0)
#define ONE_DAY                                                         24*60*60
#define Tempos                                                              2990
#define CITY_LS                                                             5242
#define CITY_SF                                                             5454
#define CITY_LV                                                             5644
#define VIP_CONF                                                   "viplist.ini"
#define MAX_CONNECTIONS_FROM_IP                                                 244
#define CONTAS                                                   "Jogadores/%s.ini"
#define PRESOS                                                      "Presos/%s.ini"
#define CONFIG                                                        "Config.ini"
#define SLOT                                                                5202
#define SCM SendClientMessage
#define SCMToAll SendClientMessageToAll
#define TEMPO                                                               600000
#define KEY_HORN                                                            2545
#define MAX_WEAPONS                                                        (220)
#define MAX_AMMO                                                         (99999)
#define Bebidas                                                              3103
#define Banir                                                               5645
#define Kickar                                                              4545
#define TIMER_UPDATEARROW                                                      100
#define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9)
#define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
#define dcmd(%1,%2) if (!strcmp((%2)[1], #%1, true, (strlen((#%1)))) && ((((%2)[(strlen((#%1))) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%2)[(strlen((#%1))) + 1] == ' ') && (dcmd_%1(playerid, (%2)[(strlen((#%1))) + 2]))))) return 1
#define SendFormattedMessage(%0,%1,%2,%3) do{new _string[128]; format(_string,sizeof(_string),%2,%3); SCM(%0,%1,_string);} while(False)
#define SendFormattedMessageToAll(%0,%1,%2) do{new _string[128]; format(_string,sizeof(_string),%1,%2); SCMToAll(%0,_string);} while(False)
#define CallbackLog(%2,%3) do{new _string[128]; format(_string,sizeof(_string),%2,%3); WriteLog("callbacks", _string);} while(False)
#define IntSave(%1)            DOF2_SetInt(file,middle("\"%1\""),Player[playerid][%1])
#define BoolLoad(%1)        Player[playerid][%1] = DOF2_GetBool(file,middle("\"%1\""))
#define IntLoad(%1)            Player[playerid][%1] = DOF2_GetInt(file,middle("\"%1\""))
#define FloatLoad(%1)        Player[playerid][%1] = DOF2_GetFloat(file,middle("\"%1\""))
#define FloatSave(%1)        DOF2_SetFloat(file,middle("\"%1\""),Player[playerid][%1])
#define ADMIN_SPEC_TYPE_NONE                                                 552
#define ADMIN_SPEC_TYPE_PLAYER                                               521
#define ADMIN_SPEC_TYPE_VEHICLE                                              455
#define MAX_LOCAIS                                                              414
#define SPECIAL_ACTION_PISSING                                                  68
#pragma unused ret_memcpy 
Reply
#8

Ai nгo tem nenhuma dialog igual
Reply
#9

Manda esses dois cуdigos
PHP код:
 #define DIALOG_COMPRARARMAS
#define PLAYER_STATE_DRIVER 
Reply
#10

Quote:
Originally Posted by FabioStralioti
Посмотреть сообщение
Manda esses dois cуdigos
PHP код:
 #define DIALOG_COMPRARARMAS
#define PLAYER_STATE_DRIVER 
STATE_DRIVER COMPLETA
PHP код:
    if ( newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        
ShowPlayerVelocimetro(playerid) ;
    }
    else
     {
        
HidePlayerVelocimetro(playerid) ;
    }
    if(
Player[playerid][pMTX] == 1)
    {
        if(
newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
         {
              if(
IsABike(GetPlayerVehicleID(playerid)))
            {
                 switch(
GetPlayerSkin(playerid))
                   {
                 
#define NOIX2{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, SLOT, 18976, 2, (%0), (%1), (%2), (%3), (%4), (%5));
                
case 06574149208273:  NOIX2{0.0700000.0000000.00000088.00000075.0000000.000000}
                case 
1..6814162227293341..4982..848687119289NOIX2{0.0700000.0000000.00000088.00000077.0000000.000000}
                case 
710NOIX2{0.0900000.0199990.00000088.00000090.0000000.000000}
                case 
9NOIX2{0.0599990.0199990.00000088.00000090.0000000.000000}
                case 
11..13NOIX2{0.0700000.0199990.00000088.00000090.0000000.000000}
                case 
15NOIX2{0.0599990.0000000.00000088.00000082.0000000.000000}
                case 
17..21NOIX2{0.0599990.0199990.00000088.00000082.0000000.000000}
                case 
23..262830..3234..3957589899104..118120..131NOIX2{0.0799990.0199990.00000088.00000082.0000000.000000}
                case 
40NOIX2{0.0500000.0099990.00000088.00000082.0000000.000000}
                case 
50100..103148150..189222NOIX2{0.0700000.0099990.00000088.00000082.0000000.000000}
                case 
51..54NOIX2{0.1000000.0099990.00000088.00000082.0000000.000000}
                case 
5556636466..73757678..81133..143147190..207209..219221247..272274..288290..293NOIX2{0.0700000.0199990.00000088.00000082.0000000.000000}
                case 
59..62NOIX2{0.0799990.0299990.00000088.00000082.0000000.000000}
                case 
77NOIX2{0.0599990.0199990.00000087.00000082.0000000.000000}
                case 
858889NOIX2{0.0700000.0399990.00000088.00000082.0000000.000000}
                case 
90..97NOIX2{0.0500000.0199990.00000088.00000082.0000000.000000}
                case 
132NOIX2{0.0000000.0199990.00000088.00000082.0000000.000000}
                case 
144..146NOIX2{0.0900000.0000000.00000088.00000082.0000000.000000}
                case 
220NOIX2{0.0299990.0199990.00000088.00000082.0000000.000000}
                case 
223246NOIX2{0.0700000.0500000.00000088.00000082.0000000.000000}
                case 
224..245NOIX2{0.0700000.0299990.00000088.00000082.0000000.000000}
                case 
294NOIX2{0.0700000.0199990.00000091.00000084.0000000.000000}
                case 
295NOIX2{0.0500000.0199980.00000086.00000082.0000000.000000}
                case 
296..298NOIX2{0.0649990.0099990.00000088.00000082.0000000.000000}
                case 
299NOIX2{0.0649980.0199990.00000088.00000082.0000000.000000}
                }
               }
        }
        else
        {
        
RemovePlayerAttachedObject(playeridSLOT);
        }
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        
SCM(playeridCOR_ROXO"[INFO] Para ver todos os comandos em relaзгo ao veнculo, digite /meuveh!");
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        if(
Privados(GetPlayerVehicleID(playerid)))
        {
            if(
Player[playerid][pPMRJ] >= || Player[playerid][pPCRJ] >= || Player[playerid][pReporterLS] >= 1)
            {
            }
            else
            {
                
RemovePlayerFromVehicle(playerid);
                   
SCM(playeridCOR_ERRO"[ERRO] Vocк nгo pode pegar esse veнculo!");
            }
        }
    }
     if(
newstate == PLAYER_STATE_DRIVER)
    {
        if(
VeiculosMTX(GetPlayerVehicleID(playerid)))
        {
             if(
Player[playerid][pMTX] < 1)
            {
                new 
Float:Pos[3];
                
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
                
SetPlayerPos(playeridPos[0], Pos[1], Pos[2]+1);
                   
SCM(playeridCOR_ERRO"[ERRO] Moto exclusiva para Moto Tбxis!");
            }
        }
     }
     if(
newstate == PLAYER_STATE_DRIVER)
    {
        if(
VeiculosGM(GetPlayerVehicleID(playerid)))
        {
             if(
Player[playerid][pAdmin] < 5)
            {
                new 
Float:Pos[3];
                
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
                
SetPlayerPos(playeridPos[0], Pos[1], Pos[2]+1);
                   
SCM(playeridCOR_ERRO"[ERRO] Veнculo exclusivo para Game-Master!");
            }
        }
     }
     
     if(
newstate == PLAYER_STATE_DRIVER)
    {
        if(
VeiculosHelper(GetPlayerVehicleID(playerid)))
        {
             if(
Player[playerid][pHelper] < 1)
            {
                new 
Float:Pos[3];
                
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
                
SetPlayerPos(playeridPos[0], Pos[1], Pos[2]+1);
                   
SCM(playeridCOR_ERRO"[ERRO] Veнculo exclusivo para Helpers!");
            }
        }
     }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        if(
VeiculosVIP(GetPlayerVehicleID(playerid)))
        {
             if(
Player[playerid][pVIP] >= 1)
            {
            }
            else
            {
                new 
Float:Pos[3];
                
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
                 
SetPlayerPos(playeridPos[0], Pos[1], Pos[2]+1);
                
SCM(playeridCOR_ERRO"[ERRO] Veнculo exclusivo para VIP's!");
            }
        }
    }
    return 
1;
}
stock EVeiculoComMotorista(vehicleid)
{
    for(new 
0MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
    return 
1;
    }
    return 
0;

DIALOG_COMPRAARMAS
PHP код:
if (strcmp("/comprararmas"cmdtexttrue10) == 0)
    {
        
ShowPlayerDialog(playeridDIALOG_COMPRARARMASDIALOG_STYLE_TABLIST_HEADERS"Escolha a Arma Desejada","Armas\tValor\nM4-A1\t$30.000\nMP5\t$25.000\nAK-47\t$50.000\nDeagle\t$15.000","Comprar""Cancelar");
           return 
1;
       }
if(
dialogid == DIALOG_COMPRARARMAS)
    {
        if(!
response) return SCM(playeridVermelho,"[ERRO] Compra Cancelada.");
        {
             if(
listitem == 0)
            {
               if(
Player[playerid][pPresoADM] == || Player[playerid][pPresoSF] == || Player[playerid][pPresoLV] == || Player[playerid][pPresoLS] == || Player[playerid][InHospital] == true || Player[playerid][InHospital] == true || Player[playerid][InDM] == true)
                return 
SCM(playeridCOR_ERRO"[ERRO] Vocк nгo fazer isso!");
              if(
GetPlayerMoney(playerid) < 30000) return SCM(playerid,Vermelho,"[ERRO] Vocк nгo tem dinheiro para comprar esta arma.");
            {
                    
GivePlayerMoney(playerid,-30000);
                    
SCM(playerid,COR_LIGHTBLUE,"Vocк comprou uma M4");
                    
GivePlayerWeapon(playerid,31,3000000);
                }
            }
            if(
listitem == 1)
            {
                if(
GetPlayerMoney(playerid) < 25000) return SCM(playeridVermelho,"[ERRO] Vocк nгo tem dinheiro para comprar estб arma.");
                {
                    
GivePlayerMoney(playerid,-25000);
                    
SCM(playerid,COR_LIGHTBLUE,"Vocк comprou uma MP5");
                    
GivePlayerWeapon(playerid,29,3000000);
                }
            }
            if(
listitem == 2)
            {
                if(
GetPlayerMoney(playerid) < 30000) return SCM(playeridVermelho,"[ERRO] Vocк nгo tem dinheiro para comprar estб arma.");
                {
                       
GivePlayerMoney(playerid,-50000);
                    
SCM(playerid,COR_LIGHTBLUE,"Vocк comprou uma AK-47");
                    
GivePlayerWeapon(playerid,30,3000000);
                }
            }
              if(
listitem == 3)
            {
                if(
GetPlayerMoney(playerid) < 15000) return SCM(playeridVermelho,"[ERRO] Vocк nгo tem dinheiro para comprar estб arma.");
                {
                       
GivePlayerMoney(playerid,-15000);
                    
SCM(playerid,COR_LIGHTBLUE,"Vocк comprou uma Desert Eagle");
                    
GivePlayerWeapon(playerid,24,3000000);
                }
            }
        }
        return 
1;
    } 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)