hlmod.hu
https://hlmod.hu/

ReAPI - Parachute Lite
https://hlmod.hu/viewtopic.php?f=134&t=29757
Oldal: 1 / 1

Szerző:  theglorious [ 2019.02.08. 16:53 ]
Hozzászólás témája:  ReAPI - Parachute Lite

ReAPI - Parachute Lite
Leírás:
  • Az ejtőernyő plugin reapi-s változata, azon belül pedig egy lite verzió. Nincs modell és animáció. (A ReHLDS Team által készített verzió egy másik algoritmuson alapul.)
Cvar / Beállítás:
  • Nincs
Verzió:
  • v11.0
Követelmények:
  • ReGameDLL_CS
  • ReApi
Kompatibilis:
  • Amx Mod X 1.8.2
  • Amx Mod X 1.8.3-1.9.0dev
Készítő:
  • Leo_BH
Plugin:
  1. #include <amxmodx>
  2. #include <reapi>
  3. #define get_bit(%1,%2)  (%1 & (1 << (%2 & 31)))
  4. #define set_bit(%1,%2)  %1 |= (1 << (%2 & 31))
  5. #define clr_bit(%1,%2)  %1 &= ~(1 << (%2 & 31))
  6. new g_bitAlive;
  7. const Float:fall_speed = -100.0
  8. public plugin_init(){
  9.     register_plugin("Parachute Lite [ReAPI]", "11.0", "Leo_[BH]");
  10.     RegisterHookChain(RG_CBasePlayer_Spawn, "RG_Spawn_Post", 1);
  11.     RegisterHookChain(RG_CBasePlayer_Killed, "RG_Player_Killed", 0);
  12.     RegisterHookChain(RG_CBasePlayer_PreThink, "RG_client_PreThink");
  13. }
  14. public RG_Spawn_Post(id) if(is_user_alive(id)) set_bit(g_bitAlive, id);
  15. public RG_Player_Killed(id) clr_bit(g_bitAlive, id);
  16. public RG_client_PreThink(id){
  17.     if(!get_bit(g_bitAlive, id)) return;
  18.     if (get_entvar(id, var_gravity) == 0.1) set_entvar(id, var_gravity, 1.0);
  19.     if (get_entvar(id, var_button) & IN_USE) {
  20.         static Float:velocity[3]
  21.         get_entvar(id, var_velocity, velocity);
  22.         if (velocity[2] < 0.0) {
  23.             set_entvar(id, var_gravity, 0.1);
  24.             velocity[2] = (velocity[2] + 40.0 < fall_speed) ? velocity[2] + 40.0 : fall_speed ;
  25.             set_entvar(id, var_velocity, velocity);
  26.         }
  27.     }
  28.     else if ((get_entvar(id, var_oldbuttons) & IN_USE)) {
  29.         set_entvar(id, var_gravity, 1.0);
  30.     }
  31. }
  32. #if AMXX_VERSION_NUM < 183
  33. public client_disconnect(id) clr_bit(g_bitAlive, id);
  34. #else
  35. public client_disconnected(id) clr_bit(g_bitAlive, id);
  36. #endif

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/