28.01.2014, 23:48
pawn Код:
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:
{
//Aquн tu error ====> ShowPlayerDialog(playerid,DIALOG, DIALOG_STYLE_LIST, "Autos", "Infernus\nTurismo", "Seleccionar", "Cancelar");
// Eso se ejecutaba antes del switch y por eso no funcionaba
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;
}