Advertisement
toribio

toribio

May 14th, 2009
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. stock GetXYInSideOfPlayer(playerid, &Float:x, &Float:y, Float:distance, bool:left=false)
  2. {
  3.     new Float:a;
  4.  
  5.     GetPlayerPos(playerid, x, y, a);
  6.     GetPlayerFacingAngle(playerid, a);
  7.  
  8.     if(IsPlayerInAnyVehicle(playerid))
  9.         GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  10.  
  11.     a += 90.0;
  12.     if(left)
  13.     {
  14.         x += (distance * floatsin(-a, degrees));
  15.         y += (distance * floatcos(-a, degrees));
  16.     } else {
  17.         x -= (distance * floatsin(-a, degrees));
  18.         y -= (distance * floatcos(-a, degrees));
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement