Posts: 321
Threads: 160
Joined: May 2009
Reputation:
0
Is it possible to make this function?
stock SetPlayerBehindPlayer(playerid, Player2)
I want that Player2 teleports behind playerid.
Posts: 2,593
Threads: 34
Joined: Dec 2007
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]);
}
Posts: 321
Threads: 160
Joined: May 2009
Reputation:
0
P[0] -= (Distance * floatsin(-P[3], degrees));
P[1] -= (Distance * floatcos(-P[3], degrees));
those return tag mismatch