Advertisement
Whitetigerswt

GetPlayerHitbox

Jul 26th, 2011
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.93 KB | None | 0 0
  1. GetPlayerHitbox(playerid, &Float:X, &Float:Y, &Float:Z) {
  2.  
  3.     #define rate 20
  4.         new Float:Velocity[3];
  5.         new Float:Position[3];
  6.         GetPlayerVelocity(playerid, Velocity[0], Velocity[1], Velocity[2]);
  7.  
  8.         GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
  9.  
  10.         Velocity[0] = Velocity[0] / 1000;
  11.         Velocity[1] = Velocity[1] / 1000;
  12.         Velocity[2] = Velocity[2] / 1000;
  13.  
  14.  
  15.         new ping = GetPlayerPing(playerid);
  16.  
  17.         if(ping < 20) ping = 20;
  18.  
  19.        
  20.         new Float:divisor = float(ping / rate);
  21.  
  22.         Velocity[0] = Velocity[0] * (ping / divisor) * ping * (rate / 3.5);
  23.         Velocity[1] = Velocity[1] * (ping / divisor) * ping * (rate / 3.5);
  24.         Velocity[2] = Velocity[2] * (ping / divisor) * ping * (rate / 3.5);
  25.  
  26.  
  27.         X = floatadd(Position[0], Velocity[0]);
  28.         Y = floatadd(Position[1], Velocity[1]);
  29.         Z = floatadd(Position[2], Velocity[2]);
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement