03.04.2011, 12:20
(
Последний раз редактировалось mprofitt; 03.04.2011 в 13:14.
)
write a simple function to create a non-manage vehicle.
pawn Код:
dcmd_createveh(playerid, params[])
{
if(GetPlayerInterior(playerid) == 0)
{
new model;
if(sscanf(params, "d", model))
{
model = 451;
}
if(model > 399 && model < 612)
{
new
veh,
Float:x,
Float:y,
Float:z,
Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
veh = CreateVehicle(model, x, y, z, a, 0, 1, 600);
SetVehicleVirtualWorld(veh, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, veh, 0);
}
else SendClientMessage(playerid, COLOR_SYSTEMMSG, "[System:] Invalid Vehicle ID.");
}
else SendClientMessage(playerid, COLOR_SYSTEMMSG, "[System:] You cannot create a vehicle within this interior.");
return 1;
}