[Ajuda] Problemas na funзгo OnDialogResponse - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Problemas na funзгo OnDialogResponse (
/showthread.php?tid=434135)
(Resolvido) Problemas na funзгo OnDialogResponse -
Strike_Legends - 01.05.2013
Ola a todos, bem nesses ultimos tempo eu estou tendo problema com OnDialogResponse, ele nгo responde o button2, todas as dialog's estб dando isso oque deve ser isso ?
Um exemplo de um code:
Код:
CMD:sexo(playerid, params[])
{
ShowPlayerDialog(playerid, 50, DIALOG_STYLE_MSGBOX, "{FFA500}"SERVER_NAME" - Registration", "{FFFFFF}Select you sex:", "Male", "Female");
}
OnDialogResponse:
Код:
if(dialogid == 50)
{
if(response) {
PlayerInfo[playerid][pSex] = 1;
PlayerInfo[playerid][pModel] = 299;
} else {
PlayerInfo[playerid][pSex] = 2;
PlayerInfo[playerid][pModel] = 55;
}
}
@Um amigo meu via skype conseguiu me ajudar a resolver o problema.
Re: Problemas na funзгo OnDialogResponse -
Bruno Bastos - 01.05.2013
pawn Код:
//----------------------------------------------------------------------Defineґs
#define D_SEXO
//-------------------------------------------------------------------------ZCMD
CMD:sexo(playerid, params[])
{
ShowPlayerDialog(playerid, 50, DIALOG_STYLE_MSGBOX, "{FFA500}"SERVER_NAME" - Registration", "{FFFFFF}Select you sex:", "Male", "Female");
}
//--------------------------------------------------------------OnDialogResponse
switch(dialogid)
{
case D_SEXO;
{
if(response)
{
switch(listitem)
{
//Lista do D_SEXO
case 0: //FUNЗГO AQUI CASO ELE SELECIONE A OPЗГO MASCULINO
case 1: //FUNЗГO AQUI, CASO ELE SELECIONE A OPЗГO FEMININO
}
}
}
}
Tente isso, boa sorte!!
Re: Problemas na funзгo OnDialogResponse -
PT - 01.05.2013
Ola
Vocк esqueceu 1 coisa
Tenta assim;
pawn Код:
//--------------- Define's ------------
#define sexo 21312
//-------- comando -------------------
CMD:sexo(playerid, params[])
{
ShowPlayerDialog(playerid, sexo, DIALOG_STYLE_MSGBOX, "{FFA500}"#SERVER_NAME" - Registration", "{FFFFFF}Select you sex:", "Male", "Female");
return 1;
}
//------- public OnDialogResponse ----
if(dialogid == sexo)
{
if(response == 1)
{
PlayerInfo[playerid][pSex] = 1;
PlayerInfo[playerid][pModel] = 299;
}
else
{
PlayerInfo[playerid][pSex] = 2;
PlayerInfo[playerid][pModel] = 55;
}
return 1;
}
Espero ajudar
PT