Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GetPlayerHitbox(playerid, &Float:X, &Float:Y, &Float:Z) {
- #define rate 20
- new Float:Velocity[3];
- new Float:Position[3];
- GetPlayerVelocity(playerid, Velocity[0], Velocity[1], Velocity[2]);
- GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
- Velocity[0] = Velocity[0] / 1000;
- Velocity[1] = Velocity[1] / 1000;
- Velocity[2] = Velocity[2] / 1000;
- new ping = GetPlayerPing(playerid);
- if(ping < 20) ping = 20;
- new Float:divisor = float(ping / rate);
- Velocity[0] = Velocity[0] * (ping / divisor) * ping * (rate / 3.5);
- Velocity[1] = Velocity[1] * (ping / divisor) * ping * (rate / 3.5);
- Velocity[2] = Velocity[2] * (ping / divisor) * ping * (rate / 3.5);
- X = floatadd(Position[0], Velocity[0]);
- Y = floatadd(Position[1], Velocity[1]);
- Z = floatadd(Position[2], Velocity[2]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement