hlmod.hu
https://hlmod.hu/

Admin bunnyhop
https://hlmod.hu/viewtopic.php?f=9&t=25540
Oldal: 1 / 1

Szerző:  Khemo [ 2016.07.15. 18:35 ]
Hozzászólás témája:  Admin bunnyhop

Ezt valaki létszives beállítaná i jogra?
Előre is köszönöm :)

Csatolmányok:
amxmodx-14817-adminbunny (1).sma [1.3 KiB]
Letöltve 79 alkalommal.

Szerző:  koko.988 [ 2016.07.15. 20:12 ]
Hozzászólás témája:  Re: Admin bunnyhop

Cvarként tudod állítani a megfelelő jogot.
Jelen esetben: ADMIN_LEVEL_C (o jog)

  1. #include <amxmodx>
  2. #include <engine>
  3.  
  4. #define FL_WATERJUMP    (1<<11)
  5. #define FL_ONGROUND (1<<9)
  6. new g_jog
  7. public plugin_init() {
  8.     register_plugin("Admin Bhop", "1.0", "Nero")
  9.     register_cvar("bhop_enabled", "1")
  10.     register_cvar("bhop_onlyadmin", "1")
  11.     register_cvar("bhop_autojump", "1")
  12.     g_jog = register_cvar("bunny_jog", "ADMIN_LEVEL_C");
  13. }
  14.  
  15. public client_PreThink(id) {
  16.     if ((get_cvar_num("bhop_onlyadmin") == 0)||(get_user_flags(id)& get_pcvar_num(g_jog)) {
  17.         if (!get_cvar_num("bhop_enabled"))
  18.             return PLUGIN_CONTINUE
  19.  
  20.         entity_set_float(id, EV_FL_fuser2, 0.0)
  21.  
  22.         if (!get_cvar_num("bhop_autojump"))
  23.             return PLUGIN_CONTINUE
  24.  
  25.         if (entity_get_int(id, EV_INT_button) & 2) {
  26.             new flags = entity_get_int(id, EV_INT_flags)
  27.  
  28.             if (flags & FL_WATERJUMP)
  29.                 return PLUGIN_CONTINUE
  30.             if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )
  31.                 return PLUGIN_CONTINUE
  32.             if ( !(flags & FL_ONGROUND) )
  33.                 return PLUGIN_CONTINUE
  34.  
  35.             new Float:velocity[3]
  36.             entity_get_vector(id, EV_VEC_velocity, velocity)
  37.             velocity[2] += 250.0
  38.             entity_set_vector(id, EV_VEC_velocity, velocity)
  39.  
  40.             entity_set_int(id, EV_INT_gaitsequence, 6)
  41.         }
  42.         return PLUGIN_CONTINUE
  43.     }
  44. }

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