29.06.2014, 00:14
Im trying to make a command that brings a car (by giving its id) to the player.
їAny idea?
їAny idea?
new Float:X, Float:Y, Float:Z, carid;
GetPlayerPos(playerid, X, Y, Z);
SetVehiclePos(carid, X,Y,Z);
CMD:car(playerid, params[])
{
new vehicleID;
if(!sscanf(params, "i", vehicleID)) // ask for vehicle ID
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z); // Get player Pos
SetVehiclePos(vehicleID, x+15, y, z); // Set vehicle pos
LinkVehicleToInterior(vehicleID, GetPlayerInterior(playerid)); // Set vehicle interior
SetVehicleVirtualWorld(vehicleID, GetPlayerVirtualWorld(playerid)); // Set VW
SendClientMessage(playerid, -1, "Here is your car!"); // Msg
}
return 1;
}