GET XYZ IN THE BACK OF VEHICLE [URGENT] - I REP !!!
#1

How to set checkpoint in the back of vehicle?
Thanks.
Reply
#2

Anybody ?
Reply
#3

What is it you're trying to do exactly?
What have you already tried that isn't working?
Reply
#4

pawn Код:
stock GetXYBehindOfVehicle(vehicleid, &Float:x, &Float:y, Float:distance)
{
    new
        Float:a;
    GetVehiclePos( vehicleid, x, y, a );
    GetVehicleZAngle( vehicleid, a );
    x += ( distance * floatsin( -a+180, degrees ));
    y += ( distance * floatcos( -a+180, degrees ));
}
Credits to Donya
Reply
#5

I am working on a garbage man job , when player exit vehicle to put him a checkpoint in the back of the garbage car.
Reply
#6

Quote:
Originally Posted by Sawalha
Посмотреть сообщение
pawn Код:
stock GetXYBehindOfVehicle(vehicleid, &Float:x, &Float:y, Float:distance)
{
    new
        Float:a;
    GetVehiclePos( vehicleid, x, y, a );
    GetVehicleZAngle( vehicleid, a );
    x += ( distance * floatsin( -a+180, degrees ));
    y += ( distance * floatcos( -a+180, degrees ));
}
Credits to Donya
And how to make it work with Setplayercheckpoint ?
Reply
#7

pawn Код:
/* Some Callback */
new veh = GetPlayerVehicleID(playerid);
new Float:X, Float:Y;
new Float:PX, Float:PY, Float:PZ;
GetPlayerPos(playerid, PX, PY, PZ); // To get Z Coordinate only.
GetXYBehindOfVehicle(vehicleid, X, Y, /* the distance */);
SetPlayerCheckPoint(playerid, X, Y, PZ, 5.0);
return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)