HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <reapi>
  3.  
  4. public plugin_init()
  5. {
  6. register_plugin("[ReAPI] Parachute", "1.1", "ReHLDS Team");
  7. RegisterHookChain(RG_PM_AirMove, "PM_AirMove", false);
  8. }
  9.  
  10. public PM_AirMove(const playerIndex)
  11. {
  12. if (!(get_entvar(playerIndex, var_button) & IN_USE)
  13. || get_entvar(playerIndex, var_waterlevel) > 0) {
  14. return;
  15. }
  16. new Float:flVelocity[3];
  17. get_entvar(playerIndex, var_velocity, flVelocity);
  18. if (flVelocity[2] < 0.0)
  19. {
  20. flVelocity[2] = (flVelocity[2] + 40.0 < -100.0) ? flVelocity[2] + 40.0 : -100.0;
  21. set_entvar(playerIndex, var_sequence, ACT_WALK);
  22. set_entvar(playerIndex, var_gaitsequence, ACT_IDLE);
  23. set_pmove(pm_velocity, flVelocity);
  24. set_movevar(mv_gravity, 80.0);
  25. }
  26. }