29.05.2015, 13:53
(
Последний раз редактировалось MouizGhouri; 29.05.2015 в 16:22.
)
~Fixed~
new vehicles_array[] =
{
400,401,402,403,404,405,406
};
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PREVMODEL, "Vehicles list", vehicles_array, "Spawn", "Cancel");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)//the dialogid
{
if(response)//if player pressed 'SPAWN'
{
new Float:pos[4];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
new vehicleid = CreateVehicle(strval(inputtext), pos[0], pos[1], pos[2], pos[3], random(255), random(255), -1);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, vehicleid, 0);
}
}
return 1;
}