how can i tell if a player is infront of a vehicles front/Bonnet?
#1

front/bonnet* not trunk sorry
does this seem possible? i tried somethign with getvehiclezangle then compared it with the players pos, but it didnt work
Reply
#2

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 ));
}
Change that to make it go infront instead of behind.
Reply
#3

oh i forgot about getxy ok ty.

wait im stuck here
pawn Код:
new Float:px,Float:py,Float:pz,Float:x,Float:y;
GetPlayerPos(playerid,px,py,pz);
GetXYInFrontOfVehicle(GetPlayerVehicleID(playerid),x,y,2.4)
if(
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)