Position behind another player
#1

How to create a function that should set a player behind me? Like SetPlayerPos1(playerid, behindid);
Reply
#2

pawn Код:
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;
}
Reply
#3

pawn Код:
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;
}
Try this..
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)