fork download
  1. /* SetPosInFrontOfPlayer INCLUDE
  2.  *
  3.  * (c) Copyright 2013, Thugman.
  4.  * Written by Thugman
  5.  *
  6.  */
  7.  
  8. /*
  9.  FUNCTION:
  10.  SetPosInFrontOfPlayer(playerid, giveplayerid, Float:distance);
  11. */
  12.  
  13. SetPosInFrontOfPlayer(playerid, giveplayerid, Float:distance)
  14. {
  15. new Float:x,Float:y,Float:z,Float:a;
  16. GetPlayerPos(playerid, x, y,z);
  17. GetPlayerFacingAngle(playerid, a);
  18. x += (distance * floatsin(-a, degrees));
  19. y += (distance * floatcos(-a, degrees));
  20. SetPlayerPos(giveplayerid,x,y,z);
  21. SetPlayerFacingAngle(giveplayerid,a);
  22. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty