Will this work?
#1

pawn Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{   // Created by ******

    new Float:a;

    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);

    if (GetPlayerVehicleID(playerid)) {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }

    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
Will that code work? It doesn't seem to return any value on the code. I havent tested it yet
Reply
#2

Would it not be wise to test the code before posting it?
Reply
#3

I cannot right now because SA-MP is not installed on this computer.
Reply
#4

Quote:
Originally Posted by Memoryz
Посмотреть сообщение
I cannot right now because SA-MP is not installed on this computer.
Couldn't you have waited and then posted if it didn't work another time?

Seems strange to me, sorry if I sound off putting.
Reply
#5

It'll store the values into pre-defined variables, for example:
pawn Код:
new Float:x, Float:y;
GetXYInfrontOfPlayer(playerid, x, y, 5.0);
That will get the X and Y coordinates 5.0 units in front of the player. (Which store in x and y)
Reply
#6

Quote:
Originally Posted by Norn
Посмотреть сообщение
Couldn't you have waited and then posted if it didn't work another time?

Seems strange to me, sorry if I sound off putting.
You sound completely off putting :P


Quote:
Originally Posted by Grim_
Посмотреть сообщение
It'll store the values into pre-defined variables, for example:
pawn Код:
new Float:x, Float:y;
GetXYInfrontOfPlayer(playerid, x, y, 5.0);
That will get the X and Y coordinates 5.0 units in front of the player. (Which store in x and y)
Thank-you, I have never seen that before, but now I know
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)