12.10.2013, 19:05
How to create a function that should set a player behind me? Like SetPlayerPos1(playerid, behindid);
stock GetPosBehindPlayer(playerid, Float:distance, &Float:px, &Float:py, &Float:pz,)
{
GetPlayerPos(playerid, px, py, pz);
GetPlayerFacingAngle(playerid, pfa);
px -= (distance * floatsin(-pfa, degrees));
py -= (distance * floatcos(-pfa, degrees));
return 1;
}
stock SetPlayerBehindPlayer(playerid, Player2)
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
SetPlayerPos(Player2, X, Y+5, Z);
SetPlayerFacingAngle(Player2, A);
return 1;
}