[Ajuda] DIALOG_STYLE_LIST
#1

Ola Galera, sou novo com programaзгo e estou com duvidas em relaзгo ao menu. Estou criando esse meu primeiro codigo, ele apresenta um problema, o menu aparece mas quando eu clico em alguma opзгo ele apenas fecha e nгo faz nada!
PHP код:
#define DIALOG_TYPE_MAINMENU 200
#define    DIALOG_TYPE_BICICLETAS 201
#define    DIALOG_TYPE_MOTOS 202
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(
dialogid == DIALOG_TYPE_MAINMENU)
    {
        if(!
response)
        {
            
SetCameraBehindPlayer(playerid);
        }
        if(
response)
        {
            switch(
listitem)
            {
                  case 
0: ShowPlayerDialog(playerid, DIALOG_TYPE_BICICLETAS, DIALOG_STYLE_LIST, "Bicicletas", "Bike\nBMX\nMountain Bike\n\nBack", "Pegar", "Fechar");
                    case 
1: ShowPlayerDialog(playerid, DIALOG_TYPE_MOTOS, DIALOG_STYLE_LIST, "Motos", "NRG-500\nFaggio\nFCR-900\nPCJ-600\nFreeway\nBF-400\nPizzaboy\nWayfarer\nCop Bike\nSanchez\nQuad\n\nBack", "Pegar", "Fechar");
            }
        }
    }
    if(
dialogid == DIALOG_TYPE_BICICLETAS)
    {
        if(!
response)
        {
            
SetCameraBehindPlayer(playerid);
        }
        if(
response)
        {
            switch(
listitem)
            {
                case 
0: aCreateThing(playerid, 509, 1);
                 case 
1: aCreateThing(playerid, 481, 2);
                case 
2: aCreateThing(playerid, 510, 3);
                 case 
3: ShowPlayerDialog(playerid, DIALOG_TYPE_MAINMENU, DIALOG_STYLE_LIST, "Car Spawn", "Bicicletas\nMotos", "Ir", "Fechar");
            }
        }
    }
    if(
dialogid == DIALOG_TYPE_MOTOS)
    {
        if(!
response)
        {
            
SetCameraBehindPlayer(playerid);
        }
        if(
response)
        {
            switch(
listitem)
            {
                case 
0: aCreateThing(playerid, 522, 4);
                  case 
1: aCreateThing(playerid, 462, 5);
                  case 
2: aCreateThing(playerid, 521, 6);
                  case 
3: aCreateThing(playerid, 461, 7);
                  case 
4: aCreateThing(playerid, 463, 8);
                  case 
5: aCreateThing(playerid, 581, 9);
                  case 
6: aCreateThing(playerid, 448, 10);
                  case 
7: aCreateThing(playerid, 586, 11);
                  case 
8: aCreateThing(playerid, 523, 12);
                  case 
9: aCreateThing(playerid, 468, 13);
                  case 
10: aCreateThing(playerid, 471, 14);
                  case 
11:ShowPlayerDialog(playerid, DIALOG_TYPE_MAINMENU, DIALOG_STYLE_LIST, "Car Spawn", "Bicicletas\nMotos", "Ir", "Fechar");
              }
        }
    }
    return 
1;
}
stock aCreateThing(playerid, thingid, orderid)
{
    new 
Float:X, Float:Y, Float:Z, Float:Angle;
    
GetPlayerPos(playerid, X, Y, Z);
    
GetPlayerFacingAngle(playerid, Angle);
    if(
IsPlayerInAnyVehicle(playerid)) DestroyVehicle(GetPlayerVehicleID(playerid));
    if(
thingid != 597 || thingid != 596 || thingid != 598 || thingid != 599 || thingid != 497 || thingid != 427)
    {
        
Vehicle[orderid] = CreateVehicle(thingid, X, Y, Z + 3, Angle, random(126), random(126), 30);
    }
    else
    {
        
Vehicle[orderid] = CreateVehicle(thingid, X, Y, Z + 3, Angle, 0, 1, 30);
    }
    
PutPlayerInVehicle(playerid, Vehicle[orderid], 0);
    return 
1;
}
public 
OnPlayerCommandText(playerid, cmdtext[])
{
    if(!
strcmp(cmdtext, "/v2", true))
    {
        {
             
ShowPlayerDialog(playerid, DIALOG_TYPE_MAINMENU, DIALOG_STYLE_LIST, "Car Spawn", "Bicicletas\nMotos", "Ir", "Fechar");
            return 
1;
        }
    }
    return 
0;
} 
Reply
#2

Код:
#define DIALOG_STYLE_LIST 203
Reply
#3

Quote:
Originally Posted by Wellington1999
Посмотреть сообщение
Код:
#define DIALOG_STYLE_LIST 203
Eai amigo, eu declarei do tipo da janela, mas nao deu certo, a janela aparece em um quadrado diferente do que o normal e sem as opзхes que eu fiz.
Nesse topico do SAMP Wiki ele nao fala pra declara o tipo da janela!!
Reply
#4

Quote:
Originally Posted by leitao85
Посмотреть сообщение
Eai amigo, eu declarei do tipo da janela, mas nao deu certo, a janela aparece em um quadrado diferente do que o normal e sem as opзхes que eu fiz.
Nesse topico do SAMP Wiki ele nao fala pra declara o tipo da janela!!
Nгo liga o cara й lesado..

Tente por return e veja se funciona..

Exemplo:
pawn Код:
case 0: return ShowPlayerDialog(playerid, DIALOG_TYPE_BICICLETAS, DIALOG_STYLE_LIST, "Bicicletas", "Bike\nBMX\nMountain Bike\n\nBack", "Pegar", "Fechar");
Faзa isso com todos
Reply
#5

vixi, coloquei o return em todos e mesmo assim nao funciono, continua do mesmo jeito!
vlw pela dica!
Reply
#6

mais alguem pode ajudar?
Reply
#7

Faz Debug
Reply
#8

onde eu Debugo com o Pawno que vem com o servidor?
Reply
#9

Galera, eu baixei esse FilterScript aqui de corrida, e ele apresenta o mesmo erro com DIALOG. Sera q num ta faltando algum arquivo?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)