Talk:Zh cn:Compiling Plugins (AMX Mod X)

From AlliedModders Wiki
Jump to: navigation, search
  1. include <amxmodx>
  2. include <fakemeta_util>
  3. include <fun>
  1. tryinclude <biohazard>
  1. if !defined _biohazard_included
       #assert Biohazard functions file required!
  1. endif


new zomb_leap, zomb_time


public plugin_init() {

    register_plugin("Bio LongJump/Leap", "0.2", "Jay-izi/TheRadiance")
    if (!is_biomod_active()) pause("ad")
    zomb_leap = register_cvar("bh_zombie_leap","enable")
    zomb_time = register_cvar("bh_zombie_leap_time","15.0")

}

public event_infect2(id) {

    if (is_user_alive(id) && is_user_firstzombie(id))
    {
         if (get_pcvar_num(zomb_leap))
         {
              new Float:leap_float=get_pcvar_float(zomb_time)
              set_task(leap_float,"leap_begin",id)
              new num = get_pcvar_num(zomb_time)
              set_hudmessage(243, 235, 12, -1.0, 0.40, 0, 6.0, 14.0)
              show_hudmessage(id, "%d seconds before you have leap",num)
         }
    }

}


public leap_begin(id) {

    if (!is_user_alive(id))
         return PLUGIN_HANDLED
    if (is_user_firstzombie(id))
    {
         set_hudmessage(243, 235, 12, -1.0, 0.40, 0, 6.0, 5.0)
         show_hudmessage(id, "You now have leap")
         give_item(id, "item_longjump")
    }
    
    return PLUGIN_CONTINUE

}