Replace a car without moving, change speed, change the angle
#1

i make checkpoint
When you climb on, it keeps the speed of your vehicle, your location, if your visual angle, and puts you in another car, and set the speed, angle, and all

But it's still not enough part,
Any idea how to do it?

(****** translate)
Reply
#2

You could retreive all the values from the current car and apply them to the next.
pawn Код:
new VID = GetPlayerVehicleID(playerid), Float:Xpos[2], Float:Ypos[2], Float:Zpos[2], Float:Angle;
GetVehiclePos(VID, Xpos[0], Ypos[0], Zpos[0]);
GetVehicleVelocity(VID, Xpos[1], Ypos[1], Zpos[1]);
GetVehicleZAngle(VID, Angle);
DestroyVehicle(VID);
VID = CreateVehicle(/*ModelID*/, Xpos[0], Ypos[1], Zpos[2], Angle, 0, 0, 99999999999);
PutPlayerInVehicle(playerid, VID, 0);
SetVehicleVelocity(VID, Xpos[1], Ypos[1], Zpos[2]);
Reply
#3

I thinking keeping the speed of the vehicle would be hard if not impossible.
Reply
#4

pawn Код:
Float:angle, Float:vx, Float:vy, Float:vz;
GetVehicleVelocity(firstvehicleid, vx, vy, vz);
GetVehicleZAngle(firstvehicleid, Angle);
//
PutPlayerInVehicle(playerid, secondvehicleid, 0);
SetVehicleVelocity(secondvehicleid, vx, vy, vz);
SetVehicleZAngle(secondvehicleid, Angle);
Reply
#5

Just set the velocity and direction/position the same. Works fine for me.
Reply
#6

thanks but my is better
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)