Originally Posted by OTACON
pawn Код:
ShowPlayerDialog(playerid,ID_DIALOG, DIALOG_STYLE_LIST, "Autos", "coche1\coche2\ncoche3\ncoche4", "Seleccionar", "Cancelar");
pawn Код:
#define ID_DIALOG (1) public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
new vehicle, Float:x, Float:y, Float:z, Float:angle; GetPlayerPos( playerid, x, y, z ); GetPlayerFacingAngle( playerid, angle );
switch(dialogid){ case ID_DIALOG:{ 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:{ vehicle = CreateVehicle( 521, x, y, z, angle, -1, -1, -1); LinkVehicleToInterior( vehicle, GetPlayerInterior( playerid ) ); SetVehicleVirtualWorld( vehicle, GetPlayerVirtualWorld( playerid ) ); PutPlayerInVehicle(playerid,vehicle,0); } case 3:{ vehicle = CreateVehicle( 522, x, y, z, angle, -1, -1, -1); LinkVehicleToInterior( vehicle, GetPlayerInterior( playerid ) ); SetVehicleVirtualWorld( vehicle, GetPlayerVirtualWorld( playerid ) ); PutPlayerInVehicle(playerid,vehicle,0); } //ETC... } } } }
return false; }
|