SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 30/09/2019, 05:18 AM   #1
SrGhost
Big Clucker
 
SrGhost's Avatar
 
Join Date: Jun 2019
Location: Uberlandia-MG
Posts: 59
Reputation: 5
Exclamation ShowPlayerDialog

Ola recentemente resolvi fazer um sistema de loja de armas a ideia e usar o comando /verarmas quando executar
o comando chamar a DIALOG_STYLE_MSGBOX e escolhendo a arma setar ao jogador e cobrar o money mas
acontece que eu seleciono a arma na dialog mas nao seta e nen cobra o money

estou usando o code dessa forma

No topo da GM

PHP Code:
#define DIALOG_VERARMAS         (8) 
Usando o comando

PHP Code:
CMD:verarmas(playerid)
{
    
ShowPlayerDialog(playeridDIALOG_VERARMASDIALOG_STYLE_LIST"Loja de armas""Uzi,R$500\nMinigun,R$1000""Selecionar""Fechar");
    return 
1;

em OnDialogResponse

PHP Code:
    if(dialogid == DIALOG_VERARMAS)
        {
            if(
response)
            {
                if(
listitem == 0)
                {
                    if(
GetPlayerMoney(playerid) < 500) return GameTextForPlayer(playerid -1"~r~Dinheiro insuficiente"50001);
                    
GivePlayerMoney(playerid, -500);
                    
SetPlayerAmmo(playerid28500);
                    
GameTextForPlayer(playerid"~r~Arma Comprada"50001);
                
                    
                    if(
listitem == 1)

                    if(
GetPlayerMoney(playerid) < 1000) return GameTextForPlayer(playerid -1"~r~Dinheiro insuficiente"50001);
                    
GivePlayerMoney(playerid, -1000);
                    
SetPlayerAmmo(playerid38500);
                    
GameTextForPlayer(playerid"~r~Arma Comprada"50001);
                    
                }
            }
        }
    return 
1;

Poderia me dizer onde errei ? isso me ajudaria muito
SrGhost is offline   Reply With Quote
Old 30/09/2019, 05:44 AM   #2
K3nshiro
Little Clucker
 
K3nshiro's Avatar
 
Join Date: Sep 2019
Posts: 18
Reputation: 0
Default Re: ShowPlayerDialog

Tenta aí mano

Obs: Não compilado.

Code:
if(dialogid == DIALOG_VERARMAS)
{
            if(response)
            {
                if(listitem == 0)
                {
                    if(GetPlayerMoney(playerid) < 500) return GameTextForPlayer(playerid -1, "~r~Dinheiro insuficiente", 5000, 1);
                    GivePlayerMoney(playerid, -500);
                    GivePlayerWeapon(playerid, 28, 500);
                    GameTextForPlayer(playerid, "~r~Arma Comprada", 5000, 1);
                }
                if(listitem == 1)
                {
                    if(GetPlayerMoney(playerid) < 1000) return GameTextForPlayer(playerid -1, "~r~Dinheiro insuficiente", 5000, 1);
                    GivePlayerMoney(playerid, -1000);
                    GivePlayerWeapon(playerid, 38, 500);
                    GameTextForPlayer(playerid, "~r~Arma Comprada", 5000, 1);
                }
            }

}
__________________
Iniciante Pawn .
K3nshiro is offline   Reply With Quote
Old 30/09/2019, 05:44 AM   #3
rjjj
Huge Clucker
 
rjjj's Avatar
 
Join Date: Jan 2014
Location: Acre, Brasil
Posts: 256
Reputation: 203
Default Re: ShowPlayerDialog

Arrume os códigos de listitem com um switch, pois desse jeito não está certo .



Para dar uma arma para o jogador, use GivePlayerWeapon.



Espero ter ajudado .
__________________


rjjj is offline   Reply With Quote
Old 30/09/2019, 06:04 AM   #4
SrGhost
Big Clucker
 
SrGhost's Avatar
 
Join Date: Jun 2019
Location: Uberlandia-MG
Posts: 59
Reputation: 5
Default Re: ShowPlayerDialog

Quote:
Originally Posted by K3nshiro View Post
Tenta aí mano

Obs: Não compilado.

Code:
if(dialogid == DIALOG_VERARMAS)
{
            if(response)
            {
                if(listitem == 0)
                {
                    if(GetPlayerMoney(playerid) < 500) return GameTextForPlayer(playerid -1, "~r~Dinheiro insuficiente", 5000, 1);
                    GivePlayerMoney(playerid, -500);
                    GivePlayerWeapon(playerid, 28, 500);
                    GameTextForPlayer(playerid, "~r~Arma Comprada", 5000, 1);
                }
                if(listitem == 1)
                {
                    if(GetPlayerMoney(playerid) < 1000) return GameTextForPlayer(playerid -1, "~r~Dinheiro insuficiente", 5000, 1);
                    GivePlayerMoney(playerid, -1000);
                    GivePlayerWeapon(playerid, 38, 500);
                    GameTextForPlayer(playerid, "~r~Arma Comprada", 5000, 1);
                }
            }

}
Funcionou man muito obrigado ja indentifiquei meu erro


Quote:
Originally Posted by rjjj View Post
Arrume os códigos de listitem com um switch, pois desse jeito não está certo .



Para dar uma arma para o jogador, use GivePlayerWeapon.



Espero ter ajudado .
opa ajudou sim obgd rsrsrs
SrGhost is offline   Reply With Quote
Old 30/09/2019, 02:46 PM   #5
oRaphael
Huge Clucker
 
oRaphael's Avatar
 
Join Date: Jul 2019
Location: Goiânia, Goias.
Posts: 198
Reputation: 2
Default Re: ShowPlayerDialog

Use:

PHP Code:
#define DIALOG_ARMAS 1 
PHP Code:
CMD:comprararmas(playerid)
{
    
ShowPlayerDialog(playeridDIALOG_ARMASDIALOG_STYLE_LIST"Loja de armas""Uzi,R$500\nMinigun,R$1000""Selecionar""Fechar");
    return 
1;

PHP Code:
if(dialogid == DIALOG_VERARMAS)
{
if(
response)
{
        if(
listitem == 0)
        {
        if(
GetPlayerMoney(playerid) < 500) return GameTextForPlayer(playerid -1"~r~Dinheiro insuficiente"50001);
        
GivePlayerMoney(playerid, -500);
        
GivePlayerWeapon(playerid28500);
        
GameTextForPlayer(playerid"~r~Arma Comprada"50001);
        }
        if(
listitem == 1)
        {
        if(
GetPlayerMoney(playerid) < 1000) return GameTextForPlayer(playerid -1"~r~Dinheiro insuficiente"50001);
        
GivePlayerMoney(playerid, -1000);
        
GivePlayerWeapon(playerid38500);
        
GameTextForPlayer(playerid"~r~Arma Comprada"50001);
        }
    }

__________________
Fundador, Hyze RPG.
oRaphael is offline   Reply With Quote
Old 30/09/2019, 04:26 PM   #6
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,408
Reputation: 326
Default Re: ShowPlayerDialog

Quote:
Originally Posted by oRaphael View Post
Use:

PHP Code:
#define DIALOG_ARMAS 1 
PHP Code:
CMD:comprararmas(playerid)
{
    
ShowPlayerDialog(playeridDIALOG_ARMASDIALOG_STYLE_LIST"Loja de armas""Uzi,R$500\nMinigun,R$1000""Selecionar""Fechar");
    return 
1;

PHP Code:
if(dialogid == DIALOG_VERARMAS)
{
if(
response)
{
        if(
listitem == 0)
        {
        if(
GetPlayerMoney(playerid) < 500) return GameTextForPlayer(playerid -1"~r~Dinheiro insuficiente"50001);
        
GivePlayerMoney(playerid, -500);
        
GivePlayerWeapon(playerid28500);
        
GameTextForPlayer(playerid"~r~Arma Comprada"50001);
        }
        if(
listitem == 1)
        {
        if(
GetPlayerMoney(playerid) < 1000) return GameTextForPlayer(playerid -1"~r~Dinheiro insuficiente"50001);
        
GivePlayerMoney(playerid, -1000);
        
GivePlayerWeapon(playerid38500);
        
GameTextForPlayer(playerid"~r~Arma Comprada"50001);
        }
    }

Você chegou a compilar isso?
__________________
Brasil New Style
172.106.11.138:7777
ipsLuan is offline   Reply With Quote
Old 01/10/2019, 09:01 PM   #7
oRaphael
Huge Clucker
 
oRaphael's Avatar
 
Join Date: Jul 2019
Location: Goiânia, Goias.
Posts: 198
Reputation: 2
Default Re: ShowPlayerDialog

Quote:
Originally Posted by ipsLuan View Post
Você chegou a compilar isso?
E quem te perguntou?
__________________
Fundador, Hyze RPG.
oRaphael is offline   Reply With Quote
Old 01/10/2019, 10:27 PM   #8
NWDMadara
Huge Clucker
 
NWDMadara's Avatar
 
Join Date: Mar 2018
Posts: 482
Reputation: 16
Default Re: ShowPlayerDialog

Quote:
Originally Posted by oRaphael View Post
E quem te perguntou?

Ele te perguntou
NWDMadara is offline   Reply With Quote
Old 02/10/2019, 05:35 PM   #9
Arleann
Big Clucker
 
Arleann's Avatar
 
Join Date: Feb 2018
Location: Chapadinha-ma
Posts: 182
Reputation: 2
Default Re: ShowPlayerDialog

Quote:
Originally Posted by NWDMadara View Post
Ele te perguntou
KKKKKKKKKKKK
__________________
Uma pessoa inteligente resolve um problema, um sábio o previne.

Albert Einstein
Arleann 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
ShowPlayerDialog Wizardking Scripting Help 3 23/01/2014 09:48 AM
ShowPlayerDialog manoc Scripting Help 8 06/01/2014 02:59 PM
ShowPlayerDialog .. Renks554 Help Archive 9 06/05/2011 04:14 PM
ShowPlayerDialog help me @Sakura Help Archive 1 04/05/2011 02:46 PM


All times are GMT. The time now is 09:02 PM.


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