Teleport vehicle to player.
#1

Im trying to make a command that brings a car (by giving its id) to the player.
їAny idea?
Reply
#2

Example:

pawn Код:
new Float:X, Float:Y, Float:Z, carid;
GetPlayerPos(playerid, X, Y, Z);
SetVehiclePos(carid, X,Y,Z);
So with the carid maybe you can already do it by yourself .
Reply
#3

ZCMD:
pawn Код:
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;
}
Reply
#4

I have a .ini system to save and load vehicle data.
So... їHow can i get the vehicle pos from there?

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)