26.06.2013, 15:08
pawn Код:
dcmd_getv(playerid,params[])
{
if(isnull(params)) return SendClientMessage(playerid, COLOUR_RED, "Usage: {FFFFFF}/getv [Vehicle ID]");
new veh = strval(params);
if(!IsValidVehicle(veh)) return Error(playerid, 5);
new str[128];
new Float:posX,Float:posY,Float:posZ,Float:Angle,Interior,VirtualWorld,VehModel;
GetPlayerPos(playerid,posX,posY,posZ);
GetPlayerFacingAngle(playerid,Angle);
VehModel = GetVehicleModel(veh);
Interior = GetPlayerInterior(playerid);
VirtualWorld = GetPlayerVirtualWorld(playerid);
SetVehiclePos(veh,posX,posY,posZ);
SetVehicleZAngle(veh,Angle);
LinkVehicleToInterior(veh,Interior);
SetVehicleVirtualWorld(veh,VirtualWorld);
PutPlayerInVehicle(playerid,veh,0);
format(str, sizeof(str), "|-_ You Have Teleported Vehicle ID: %d - Name: %s To Your Position _-|", veh, VehicleNames[VehModel - 400]);
return SendClientMessage(playerid, COLOUR_BLUE, str);
}