teleporting behind
#1

Код:
SetPlayerPos(playerid, x+2, y, z);
i need help with this. when im using /g i want to teleport behind players but i dont know how to edit this code. help please.
Reply
#2

pawn Код:
GetXYBehindPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if(IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    x -= (distance * floatsin(-a, degrees));
    y -= (distance * floatcos(-a, degrees));
    return 1;
}
Example:
pawn Код:
GetXYBehindPlayer(target, x, y, 2.0);
SetPlayerPos(playerid, x, y, z);
Reply
#3

thx +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)