18.02.2015, 23:22
pawn Код:
CMD:v(playerid, params[])
{
if(isnull(params) || strlen(params) > 9) SendClientMessage(playerid, COLOR_GREY, "Usage: /v [ID/name]");
else
{
VehicleID = GetVehicleModelIDFromName(params);
if(!(400 <= VehicleID <= 611))
VehicleID = strval(params);
if(!(400 <= VehicleID <= 611)) SendClientMessage(playerid, COLOR_GREY,"Error: Bad ID or name.");
else{
new Float:x,Float:y,Floatz:
GetPlayerPos(playerid, x, y, z);
GetXYInFrontOfPlayer(playerid, x, y, 5.0);
VehicleID = CreateVehicle(VehicleID, x, y, z, 0.0, 255, 255, -1);
SetVehicleVirtualWorld(VehicleID, GetPlayerVirtualWorld(playerid));
}
}
return 1;
}