Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. bool is_slow_walking(SDK::CBaseEntity * entity) {
  2. float velocity_2D[64], old_velocity_2D[64];
  3.  
  4. if (entity->GetVelocity().Length2D() != velocity_2D[entity->GetIndex()] && entity->GetVelocity().Length2D() != NULL) {
  5. old_velocity_2D[entity->GetIndex()] = velocity_2D[entity->GetIndex()];
  6. velocity_2D[entity->GetIndex()] = entity->GetVelocity().Length2D();
  7. }
  8.  
  9. if (velocity_2D[entity->GetIndex()] > 0.1) {
  10. int tick_counter[64];
  11.  
  12. if (velocity_2D[entity->GetIndex()] == old_velocity_2D[entity->GetIndex()])
  13. ++tick_counter[entity->GetIndex()];
  14. else
  15. tick_counter[entity->GetIndex()] = 0;
  16.  
  17. while (tick_counter[entity->GetIndex()] > (1 / INTERFACES::Globals->interval_per_tick) * fabsf(0.1f))// should give use 100ms in ticks if their speed stays the same for that long they are definetely up to something..
  18. return true;
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement