public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/lojaapple", true) == 0) { ShowPlayerDialog(playerid, 0, DIALOG_STYLE_TABLIST_HEADERS, "Apple", "Produtos\tServiзo\nCelulares\tApple\nComputadores\tApple\nNotebooks\tApple", "Selecionar", "Fechar"); } return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 0) { if(response) { if(listitem == 0) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_TABLIST_HEADERS, "Apple", "Produtos\tPreзo\niPhone X\t$6999\niPhone 8 Plus\t$4599\niPhone 8\t$3999\niPhone 7 Plus\t$3799\niPhone 7\t$3199", "Selecionar", "Fechar"); } if(listitem == 1) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_TABLIST_HEADERS, "Apple", "Produtos\tPreзo\niMac\t$9799\niMac Pro\t$37999", "Selecionar", "Fechar"); } } } return 1; }
#define dLojaApple 100
#define dLA1 101
#define dLA2 102
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/lojaapple", true) == 0) {
ShowPlayerDialog(playerid, dLojaApple, DIALOG_STYLE_TABLIST_HEADERS, "Apple", "Produtos\tServiзo\nCelulares\tApple\nComputadores\tApple\nNotebooks\tApple", "Selecionar", "Fechar");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == dLojaApple)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, dLA1, DIALOG_STYLE_TABLIST_HEADERS, "Apple", "Produtos\tPreзo\niPhone X\t$6999\niPhone 8 Plus\t$4599\niPhone 8\t$3999\niPhone 7 Plus\t$3799\niPhone 7\t$3199", "Selecionar", "Fechar");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, dLA2, DIALOG_STYLE_TABLIST_HEADERS, "Apple", "Produtos\tPreзo\niMac\t$9799\niMac Pro\t$37999", "Selecionar", "Fechar");
}
}
}
return 1;
}
Topo do GM:
PHP код:
Apуs definir, mude o parвmetro dialogid. PHP код:
|
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/lojaapple", true) == 0) {
ShowPlayerDialog(playerid, dLojaApple, DIALOG_STYLE_TABLIST_HEADERS, "Apple", "Produtos\tServiзo\nCelulares\tApple\nComputadores\tApple\nNotebooks\tApple", "Selecionar", "Fechar");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == dLojaApple)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, dLA1, DIALOG_STYLE_TABLIST_HEADERS, "Apple", "Produtos\tPreзo\niPhone X\t$6999\niPhone 8 Plus\t$4599\niPhone 8\t$3999\niPhone 7 Plus\t$3799\niPhone 7\t$3199", "Selecionar", "Fechar");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, dLA2, DIALOG_STYLE_TABLIST_HEADERS, "Apple", "Produtos\tPreзo\niMac\t$9799\niMac Pro\t$37999", "Selecionar", "Fechar");
}
}
return 1;
}
return 0;
}
Perdгo, eu nгo percebi o return true abaixo do comando e, sua OnPlayerCommandText estб incorreta, nunca iria retornar erro(SERVER: Unknown command.) caso o comando fosse invбlido nos scripts usados pelo servidor, neste caso.
Mude-a para PHP код:
PHP код:
|