Help Me, Operation
#6

Quote:
Originally Posted by Jastak
Посмотреть сообщение
No, it isn't the what i want. That function not drops position behind of the car as in the example.
The car looked like a point in the picture, couldn't determine in which direction is faces

So here you go, the function generalised
pawn Код:
GetXYAroundPlayer(playerid, & Float: X, & Float: Y, Float: distance, Float: angle) {
    new
        Float: A
    ;
    if(GetPlayerPos(playerid, X, Y, A)) {
        new
            vehicleid = GetPlayerVehicleID(playerid)
        ;
        if(vehicleid) {
            GetVehicleZAngle(vehicleid, A);
        } else {
            GetPlayerFacingAngle(playerid, A);
        }
        A += angle;
    X -= distance * floatsin(A, degrees);
    Y += distance * floatcos(A, degrees);
        return true;
    }
    return false;
}
To get the position behind use 180.0 for the angle
Reply


Messages In This Thread
Help Me, Operation - by Jastak - 18.09.2015, 22:37
Re: Help Me, Operation - by Andre02 - 18.09.2015, 22:41
Re: Help Me, Operation - by Jastak - 18.09.2015, 22:45
AW: Help Me, Operation - by Nero_3D - 19.09.2015, 02:02
Re: Help Me, Operation - by Jastak - 19.09.2015, 02:24
AW: Re: Help Me, Operation - by Nero_3D - 19.09.2015, 11:13
Re: Help Me, Operation - by M0HAMMAD - 19.09.2015, 12:11

Forum Jump:


Users browsing this thread: 1 Guest(s)