SetPlayerBehindID
#5

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
stock SetPlayerBehindPlayer(playerid, Player2, Float:Distance = 2.0)
{
    new Float:P[4];
    GetPlayerPos(playerid, P[0], P[1], P[2]);
    GetPlayerFacingAngle(playerid, P[3]);
    P[0] -= (Distance * floatsin(-P[3], degrees));
    P[1] -= (Distance * floatcos(-P[3], degrees));
    SetPlayerPos(Player2, P[0], P[1], P[2]);
    SetPlayerFacingAngle(Player2, P[3]);
}
Just out of curiosity, I wanna know what does floatcos and floatsin do here?

Couldn't we just do simply like that? Please explain.

pawn Код:
stock SetPlayerBehindPlayer(playerid, Player2)
{
    new Float:P[4];
    GetPlayerPos(playerid, P[0], P[1], P[2]);
    GetPlayerFacingAngle(playerid, P[3]);
    SetPlayerPos(Player2, P[0]-2, P[1], P[2]);
    SetPlayerFacingAngle(Player2, P[3]);
     return 1;
}
Reply


Messages In This Thread
SetPlayerBehindID - by ajwar - 17.12.2013, 13:59
Re: SetPlayerBehindID - by Jefff - 17.12.2013, 14:11
Re: SetPlayerBehindID - by ajwar - 17.12.2013, 14:47
Re: SetPlayerBehindID - by ajwar - 18.12.2013, 18:24
Re: SetPlayerBehindID - by Tayab - 18.12.2013, 19:00
Re: SetPlayerBehindID - by CutX - 18.12.2013, 19:20

Forum Jump:


Users browsing this thread: 2 Guest(s)