[Ayuda] Error usando DIALOG [Novato]
#1

Hola!
Es la primera vez que intento usar los dialog's, y me topй con un error.
Un comando para elegir autos/motos

El compilador no lo muestra, pero al probar el cуdigo en el juego, no puedo elegir motos, y al elegir entre autos o motos, cualquiera que elija me saca un auto.

Aquн el cуdigo:
Код:
#define DIALOG 1  //defino DIALOG
//este es el comando:
 if (strcmp("/vehiculos" , cmdtext, true, 10) == 0)
  {
    ShowPlayerDialog(playerid, DIALOG, DIALOG_STYLE_LIST, "VEHICULOS:", "Autos\nMotos", "Seleccionar", "Cancelar");

  }

Y aquн el DialogResponse, aquн debe estar el bug, pero no sй cual es :S

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(response)
  {
     new vehicle, Float:x, Float:y, Float:z, Float:angle;
     GetPlayerPos( playerid, x, y, z );
     GetPlayerFacingAngle( playerid, angle );

    
	switch(dialogid)
   	{
     case 1:
           {
             ShowPlayerDialog(playerid,DIALOG, DIALOG_STYLE_LIST, "Autos", "Infernus\nTurismo", "Seleccionar", "Cancelar");
             if(response)
             {
			  switch(listitem)
		      {
		        case 0:
		        {
                  vehicle = CreateVehicle( 411, x, y, z, angle, -1, -1, -1);
                  LinkVehicleToInterior( vehicle, GetPlayerInterior( playerid ) );
                  SetVehicleVirtualWorld( vehicle, GetPlayerVirtualWorld( playerid ) );
                  PutPlayerInVehicle(playerid,vehicle,0);
		        }
		       
		        case 1:
		        {
                  vehicle = CreateVehicle( 451, x, y, z, angle, -1, -1, -1);
                  LinkVehicleToInterior( vehicle, GetPlayerInterior( playerid ) );
                  SetVehicleVirtualWorld( vehicle, GetPlayerVirtualWorld( playerid ) );
                  PutPlayerInVehicle(playerid,vehicle,0);
		        }
			   }
             }
		   }
	 case 2:
		   {
             ShowPlayerDialog(playerid, DIALOG+1, DIALOG_STYLE_LIST, "Motos", "FCR-900\nNRG-500", "Seleccionar", "Cancelar");
			 if(response)
			 {
			   switch(listitem)
			   {
			     case 0:
                 {
                   vehicle = CreateVehicle( 521, x, y, z, angle, -1, -1, -1);
                   LinkVehicleToInterior( vehicle, GetPlayerInterior( playerid ) );
                   SetVehicleVirtualWorld( vehicle, GetPlayerVirtualWorld( playerid ) );
                   PutPlayerInVehicle(playerid,vehicle,0);
			     }
			     case 1:
			     {
                   vehicle = CreateVehicle( 522, x, y, z, angle, -1, -1, -1);
                   LinkVehicleToInterior( vehicle, GetPlayerInterior( playerid ) );
                   SetVehicleVirtualWorld( vehicle, GetPlayerVirtualWorld( playerid ) );
                   PutPlayerInVehicle(playerid,vehicle,0);
			     }
			    }
			  }
			}
	}
  }

 return 1;
}
Quй es lo que hice mal?
Es la primera vez que pruebo usar esto -.-"

Gracias de antemano.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)