Raised This Month: $32 Target: $400
 8% 

Suggestion / Subplugin Request (request) Zombie run with reload key


Post New Thread Reply   
 
Thread Tools Display Modes
Isaac999
Senior Member
Join Date: Nov 2011
Location: Home
Old 12-07-2011 , 09:22   Re: (request) Zombie run with reload key
Reply With Quote #11

Quote:
Originally Posted by JoKeR LauGh View Post
Code:
#include <amxmodx> #include <fun> #include <fakemeta> new cvar_run new g_RunFast[33] public plugin_init() { register_plugin("When Press R go fast run", "0.1", "ZP Member") register_forward(FM_CmdStart, "CmdRun") cvar_run = register_cvar("Run Speed", "300") } public CmdRun(id, uc_handle, seed) {         if(!is_user_alive(id)) return FMRES_IGNORED;             if(pev(id, pev_button) & IN_RELOAD && !(pev(id, pev_oldbuttons) & IN_RELOAD))         {                      CmdRunStart(id)                 g_RunFast[id] = true;         }                 return FMRES_IGNORED } public CmdSlowStart(id) {      if (is_user_alive(id))        {        set_user_maxspeed(id, get_user_maxspeed(id) + get_pcvar_float ( cvar_run ) )        } }
How about zombie class?
__________________
Isaac999 is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-08-2011 , 02:28   Re: (request) Zombie run with reload key
Reply With Quote #12

Quote:
Originally Posted by Isaac999 View Post
How about zombie class?
PHP Code:
new g_ZombieClassID

public plugin_init()
{
    
g_ZombieClassID zp_class_zombie_get_id("Classic Zombie")
}

public 
Function1(id)
{
    if(
zp_class_zombie_get_current(id) == g_ZombieClassID)
    {
        
// do what you want
    
}

And stop double posting, you did that twice in this thread. Zombie Plague forum still follows Global Rules.

Last edited by Excalibur.007; 12-08-2011 at 02:30.
Excalibur.007 is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 12-08-2011 , 05:06   Re: (request) Zombie run with reload key
Reply With Quote #13

Optomize

PHP Code:
public Function1(id)
{
        new 
current_zclass zp_class_zombie_get_current(id)
        if (
current_zclass == ZP_INVALID_ZOMBIE_CLASS)
                return; 
// Or return PLUGIN_HANDLED;
        
        
if (current_zclass == g_ZombieClassID)
        {
                
// do somthing
        
}

__________________
Snaker beatter is offline
Isaac999
Senior Member
Join Date: Nov 2011
Location: Home
Old 12-08-2011 , 09:08   Re: (request) Zombie run with reload key
Reply With Quote #14

Quote:
Originally Posted by Excalibur.007 View Post
PHP Code:
new g_ZombieClassID

public plugin_init()
{
    
g_ZombieClassID zp_class_zombie_get_id("Classic Zombie")
}

public 
Function1(id)
{
    if(
zp_class_zombie_get_current(id) == g_ZombieClassID)
    {
        
// do what you want
    
}

And stop double posting, you did that twice in this thread. Zombie Plague forum still follows Global Rules.
Quote:
Originally Posted by Snaker beatter View Post
Optomize

PHP Code:
public Function1(id)
{
        new 
current_zclass zp_class_zombie_get_current(id)
        if (
current_zclass == ZP_INVALID_ZOMBIE_CLASS)
                return; 
// Or return PLUGIN_HANDLED;
        
        
if (current_zclass == g_ZombieClassID)
        {
                
// do somthing
        
}


PLease make zombie class: "Common" that can run faster when press "R" key
__________________

Last edited by Isaac999; 12-08-2011 at 09:09.
Isaac999 is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-09-2011 , 07:12   Re: (request) Zombie run with reload key
Reply With Quote #15

Code:
#include <amxmodx> #include <fakemeta> #include <fun> #include <zp50_core> new const VERSION[] = "1.0.1" new const BREATHING_SOUND[] = "zombie_plague/sprint_post.wav" new g_bitAlivePlayers, g_bitSprintingPlayers, g_bitAllowedPlayers, g_bitCoolDownPlayers #define MarkUserAlive(%0)       g_bitAlivePlayers |= (1 << (%0 & 31)) #define ClearUserAlive(%0)      g_bitAlivePlayers &= ~(1 << (%0 & 31)) #define IsUserAlive(%0)  g_bitAlivePlayers & (1 << (%0 & 31)) #define MarkUserSprinting(%0)   g_bitSprintingPlayers |= (1 << (%0 & 31)) #define ClearUserSprinting(%0)  g_bitSprintingPlayers &= ~(1 << (%0 & 31)) #define IsUserSprinting(%0) g_bitSprintingPlayers & (1 << (%0 & 31)) #define MarkUserAllowed(%0) g_bitAllowedPlayers |= (1 << (%0 & 31)) #define ClearUserAllowed(%0)    g_bitAllowedPlayers &= ~(1 << (%0 & 31)) #define IsUserAllowed(%0)   g_bitAllowedPlayers & (1 << (%0 & 31)) #define MarkUserCoolDown(%0)    g_bitCoolDownPlayers |= (1 << (%0 & 31)) #define ClearUserCoolDown(%0)   g_bitCoolDownPlayers &= ~(1 << (%0 & 31)) #define IsUserCoolDown(%0)  g_bitCoolDownPlayers & (1 << (%0 & 31)) #define ADVERTISE_SPRINT    60.0 new cvar_sprintspeedadder, cvar_sprintmaxduration, cvar_mintimeforsoundeffect new Float:flSprintSpeedAdder, Float:flSprintMaxDuration, Float:flMinTimeForSoundEffect new Float:flSprintDuration[33], iCurWeapon[33] new iMaxPlayers public plugin_precache() {     precache_sound(BREATHING_SOUND) } public plugin_init() {     register_plugin("[ZP] Addon: Sprinting", VERSION, "Excalibur.007")         register_clcmd("sprint", "command_sprint")     register_clcmd("say /sprint", "menu_permission")     register_clcmd("say_team /sprint", "menu_permission")         cvar_sprintspeedadder = register_cvar("zp_sprint_speed_adder", "50")     cvar_sprintmaxduration = register_cvar("zp_sprint_max_duration", "7.0")     cvar_mintimeforsoundeffect = register_cvar("zp_sprint_min_time_for_sound", "5.0")         register_event("HLTV", "event_new_round", "a", "1=0", "2=0")     register_event("DeathMsg", "event_DeathMsg", "a")     register_event("CurWeapon", "event_CurWeapon", "be")         register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")         iMaxPlayers = get_maxplayers() } public plugin_cfg() {     flSprintSpeedAdder = get_pcvar_float(cvar_sprintspeedadder)     flSprintMaxDuration = get_pcvar_float(cvar_sprintmaxduration)     flMinTimeForSoundEffect = get_pcvar_float(cvar_mintimeforsoundeffect)         set_task(ADVERTISE_SPRINT, "advertisement_text", 0) } public advertisement_text(id) {     client_print(0, print_chat, "[Sprint] Type ^"/sprint^" to enable/disable sprint realism through a menu")     client_print(0, print_chat, "[Sprint] You will be still able to sprint even it's disabled. Just that it will not be realistic.") } public client_putinserver(id) {     set_task(5.0, "menu_permission", id) } public client_disconnect(id) {     ClearUserAlive(id)     ClearUserSprinting(id)     ClearUserCoolDown(id)         if(IsUserAllowed(id))     {         client_cmd(id, "cl_bob 0.01")                 ClearUserAllowed(id)     } } public event_new_round() {     flSprintSpeedAdder = get_pcvar_float(cvar_sprintspeedadder)     flSprintMaxDuration = get_pcvar_float(cvar_sprintmaxduration)     flMinTimeForSoundEffect = get_pcvar_float(cvar_mintimeforsoundeffect)         for(new i = 0; i < iMaxPlayers; i++)     {         ClearUserSprinting(i)         ClearUserCoolDown(i)                 if(IsUserAllowed(i))             client_cmd(i, "cl_bob 0.01")     } } public event_DeathMsg() {     new iVictim = read_data(2)         ClearUserAlive(iVictim)     ClearUserSprinting(iVictim)     ClearUserCoolDown(iVictim)         if(IsUserAllowed(iVictim))         client_cmd(iVictim, "cl_bob 0.01") } public event_CurWeapon(id) {     if(~IsUserAlive(id) || !zp_core_is_zombie(id))         return PLUGIN_CONTINUE             iCurWeapon[id] = read_data(2)         return PLUGIN_CONTINUE } public fw_PlayerPreThink(id) {     if(~IsUserAlive(id) || !zp_core_is_zombie(id))         return FMRES_IGNORED             if(IsUserSprinting(id))         cs_set_user_sprint_speed(id)             return FMRES_IGNORED } public zp_fw_core_spawn_post(id) {     if(!is_user_alive(id))         return PLUGIN_CONTINUE             MarkUserAlive(id)     ClearUserSprinting(id)     ClearUserCoolDown(id)         if(IsUserAllowed(id))         client_cmd(id, "cl_bob 0.01")         return PLUGIN_CONTINUE } public command_sprint(id) {     if(~IsUserAlive(id) || !zp_core_is_zombie(id) || IsUserCoolDown(id))         return PLUGIN_CONTINUE             if(IsUserSprinting(id))     {         ClearUserSprinting(id)                 if(IsUserAllowed(id))             client_cmd(id, "cl_bob 0.01")                     if(flSprintDuration[id] >= flMinTimeForSoundEffect)             client_cmd(id, "spk %s", BREATHING_SOUND)                 set_task(flSprintDuration[id], "reset_vars", id)     }     else     {         new IsDucking = (pev(id, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND))                 if(!IsDucking)         {             MarkUserSprinting(id)                         if(IsUserAllowed(id))                 client_cmd(id, "cl_bob 0.05")                             set_task(0.25, "hook_sprint_duration", id)         }     }         return PLUGIN_CONTINUE } public hook_sprint_duration(id) {     if(~IsUserAlive(id) || !zp_core_is_zombie(id) || ~IsUserSprinting(id))         return PLUGIN_CONTINUE             new IsDucking = (pev(id, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND))         if(IsDucking)     {         ClearUserSprinting(id)                 if(IsUserAllowed(id))             client_cmd(id, "cl_bob 0.01")                     MarkUserCoolDown(id)                 if(flSprintDuration[id] >= flMinTimeForSoundEffect)             client_cmd(id, "spk %s", BREATHING_SOUND)                 set_task(flSprintDuration[id], "reset_vars", id)                     return PLUGIN_CONTINUE     }             flSprintDuration[id] += 0.25         if(flSprintDuration[id] >= flSprintMaxDuration)     {         ClearUserSprinting(id)                 if(IsUserAllowed(id))             client_cmd(id, "cl_bob 0.01")                     MarkUserCoolDown(id)                 if(flSprintDuration[id] >= flMinTimeForSoundEffect)             client_cmd(id, "spk %s", BREATHING_SOUND)                 set_task(flSprintDuration[id], "reset_vars", id)     }         set_task(0.25, "hook_sprint_duration", id)         return PLUGIN_CONTINUE } public reset_vars(id) {     client_cmd(id, "stopsound")         if(~IsUserAlive(id))         return PLUGIN_CONTINUE             ClearUserCoolDown(id)     flSprintDuration[id] = 0.0         return PLUGIN_CONTINUE } public menu_permission(id) {     new menu = menu_create("\yDo you allow ^"Sprint^" plugin to edit your CVar for realism?", "menu_handler")         menu_additem(menu, "\wYes", "1", 0)     menu_additem(menu, "\wNo", "2", 0)         menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)     menu_display(id, menu, 0) } public menu_handler(id, menu, item) {     if(item == MENU_EXIT)     {         menu_destroy(menu)         return PLUGIN_HANDLED     }         new data[6], szName[64]     new access, callback         menu_item_getinfo(menu, item, access, data, charsmax(data), szName,charsmax(szName), callback)         new key = str_to_num(data)         switch(key)     {         case 1:         {             MarkUserAllowed(id)                         client_print(id, print_chat, "[Sprint] Sprint realism is now enabled.")             client_print(id, print_chat, "[Sprint] Open up your console(~) and bind a key to sprint. e.g. bind v sprint")                         menu_destroy(menu)             return PLUGIN_HANDLED         }         case 2:         {             ClearUserAllowed(id)                         client_cmd(id, "cl_bob 0.01")                         client_print(id, print_chat, "[Sprint] Sprint realism is now disabled.")                         menu_destroy(menu)             return PLUGIN_HANDLED         }     }         menu_destroy(menu)     return PLUGIN_HANDLED } stock cs_set_user_sprint_speed(id) {     new Float:flMaxSpeed         switch(iCurWeapon[id])     {         case CSW_SG550, CSW_AWP, CSW_G3SG1 : flMaxSpeed = (210.0 + flSprintSpeedAdder)         case CSW_M249 : flMaxSpeed = (220.0 + flSprintSpeedAdder)         case CSW_AK47 : flMaxSpeed = (221.0 + flSprintSpeedAdder)         case CSW_M3, CSW_M4A1 : flMaxSpeed = (230.0 + flSprintSpeedAdder)         case CSW_SG552 : flMaxSpeed = (235.0 + flSprintSpeedAdder)         case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS : flMaxSpeed = (240.0 + flSprintSpeedAdder)         case CSW_P90 : flMaxSpeed = (245.0 + flSprintSpeedAdder)         case CSW_SCOUT : flMaxSpeed = (260.0 + flSprintSpeedAdder)         default : flMaxSpeed = (250.0 + flSprintSpeedAdder)     }         set_user_maxspeed(id, flMaxSpeed) }

Note: This is an edit base on my Basic Scripting plugin

Also, players have to manually bind a button to "sprint". Example: bind v sprint

EDIT: For the sound, go to the thread and download it.

Last edited by Excalibur.007; 12-09-2011 at 07:13.
Excalibur.007 is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 12-09-2011 , 09:52   Re: (request) Zombie run with reload key
Reply With Quote #16

PHP Code:
~IsUserSprinting(id
Exca , whats
PHP Code:

for? sorry for my n3wb question my scripting level is low . Add meh on steam : muhdarif
;)
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.

Last edited by JoKeR LauGh; 12-09-2011 at 09:52.
JoKeR LauGh is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-09-2011 , 20:02   Re: (request) Zombie run with reload key
Reply With Quote #17

Quote:
Originally Posted by JoKeR LauGh View Post
PHP Code:
~IsUserSprinting(id
Exca , whats
PHP Code:

for? sorry for my n3wb question my scripting level is low . Add meh on steam : muhdarif
;)
IsUserSprinting is using bitsum. ~ is like ! on natives like !is_user_alive(index).
Bitsum is better than bool but just a little more confusing.
Excalibur.007 is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 12-10-2011 , 10:40   Re: (request) Zombie run with reload key
Reply With Quote #18

Code:
#include <amxmodx> #include <fun> #include <fakemeta> #include <zp50_core> #include <zp50_class_nemesis> #include <zp50_class_zombie> #include <zp50_colorchat> #include <zp50_colorchat_const> new g_zclass_sprint new const zclass_name[] = "Sprinter" new const zclass_desc[] = "Press R to sprint" new const zclass_model[] = "zombie_source" new const zclass_claw[] = "models/zombie_plague/v_knife_zombie.mdl" const zclass_health = 1400 const Float:zclass_speed = 1.0 const Float:zclass_gravity = 1.0 const Float:zclass_knockback = 1.0 new cvar_run public plugin_precache() {     g_zclass_sprint = zp_class_zombie_register(zclass_name, zclass_desc, zclass_health, zclass_speed, zclass_gravity)         new index         zp_class_zombie_register_kb(g_zclass_sprint, zclass_knockback)         for (index = 0; index < sizeof zclass_model; index++)             zp_class_zombie_register_model(g_zclass_sprint, zclass_model[index])             for (index = 0; index < sizeof zclass_claw; index++)             zp_class_zombie_register_claw(g_zclass_sprint, zclass_claw[index]) } public plugin_init() {     register_plugin("[ZP] Zclass Runner", "0.1", "ZP Member")         register_forward(FM_CmdStart, "CmdRun")         cvar_run = register_cvar("Run Speed", "300") } public zp_fw_class_zombie_select_pre(id, classid) {     if ( classid == g_zclass_sprint )     {         zp_colored_print(id, "^x04[ZP]^x01 You have chosen ^x04%s^x01 , Press ^x04R^x01 to ^x04Sprint^x01!", zclass_name)     } } public CmdRun(id, uc_handle, seed) {     if(!is_user_alive(id)) return FMRES_IGNORED;     {         if ( zp_class_nemesis_get(id) ) return;         if ( zp_class_zombie_get_current(id) == g_zclass_sprint )         {             if(pev(id, pev_button) & IN_RELOAD && !(pev(id, pev_oldbuttons) & IN_RELOAD))             {                 CmdRunStart(id)             }         }     }                 return FMRES_IGNORED } public CmdRunStart(id) {     if (is_user_alive(id))     {         set_user_maxspeed(id, get_pcvar_float ( cvar_run ) )     } }
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
Isaac999
Senior Member
Join Date: Nov 2011
Location: Home
Old 12-11-2011 , 07:31   Re: (request) Zombie run with reload key
Reply With Quote #19

Quote:
Originally Posted by Excalibur.007 View Post
Code:
#include <amxmodx> #include <fakemeta> #include <fun> #include <zp50_core> new const VERSION[] = "1.0.1" new const BREATHING_SOUND[] = "zombie_plague/sprint_post.wav" new g_bitAlivePlayers, g_bitSprintingPlayers, g_bitAllowedPlayers, g_bitCoolDownPlayers #define MarkUserAlive(%0)       g_bitAlivePlayers |= (1 << (%0 & 31)) #define ClearUserAlive(%0)      g_bitAlivePlayers &= ~(1 << (%0 & 31)) #define IsUserAlive(%0)  g_bitAlivePlayers & (1 << (%0 & 31)) #define MarkUserSprinting(%0)   g_bitSprintingPlayers |= (1 << (%0 & 31)) #define ClearUserSprinting(%0)  g_bitSprintingPlayers &= ~(1 << (%0 & 31)) #define IsUserSprinting(%0) g_bitSprintingPlayers & (1 << (%0 & 31)) #define MarkUserAllowed(%0) g_bitAllowedPlayers |= (1 << (%0 & 31)) #define ClearUserAllowed(%0)    g_bitAllowedPlayers &= ~(1 << (%0 & 31)) #define IsUserAllowed(%0)   g_bitAllowedPlayers & (1 << (%0 & 31)) #define MarkUserCoolDown(%0)    g_bitCoolDownPlayers |= (1 << (%0 & 31)) #define ClearUserCoolDown(%0)   g_bitCoolDownPlayers &= ~(1 << (%0 & 31)) #define IsUserCoolDown(%0)  g_bitCoolDownPlayers & (1 << (%0 & 31)) #define ADVERTISE_SPRINT    60.0 new cvar_sprintspeedadder, cvar_sprintmaxduration, cvar_mintimeforsoundeffect new Float:flSprintSpeedAdder, Float:flSprintMaxDuration, Float:flMinTimeForSoundEffect new Float:flSprintDuration[33], iCurWeapon[33] new iMaxPlayers public plugin_precache() {     precache_sound(BREATHING_SOUND) } public plugin_init() {     register_plugin("[ZP] Addon: Sprinting", VERSION, "Excalibur.007")         register_clcmd("sprint", "command_sprint")     register_clcmd("say /sprint", "menu_permission")     register_clcmd("say_team /sprint", "menu_permission")         cvar_sprintspeedadder = register_cvar("zp_sprint_speed_adder", "50")     cvar_sprintmaxduration = register_cvar("zp_sprint_max_duration", "7.0")     cvar_mintimeforsoundeffect = register_cvar("zp_sprint_min_time_for_sound", "5.0")         register_event("HLTV", "event_new_round", "a", "1=0", "2=0")     register_event("DeathMsg", "event_DeathMsg", "a")     register_event("CurWeapon", "event_CurWeapon", "be")         register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")         iMaxPlayers = get_maxplayers() } public plugin_cfg() {     flSprintSpeedAdder = get_pcvar_float(cvar_sprintspeedadder)     flSprintMaxDuration = get_pcvar_float(cvar_sprintmaxduration)     flMinTimeForSoundEffect = get_pcvar_float(cvar_mintimeforsoundeffect)         set_task(ADVERTISE_SPRINT, "advertisement_text", 0) } public advertisement_text(id) {     client_print(0, print_chat, "[Sprint] Type ^"/sprint^" to enable/disable sprint realism through a menu")     client_print(0, print_chat, "[Sprint] You will be still able to sprint even it's disabled. Just that it will not be realistic.") } public client_putinserver(id) {     set_task(5.0, "menu_permission", id) } public client_disconnect(id) {     ClearUserAlive(id)     ClearUserSprinting(id)     ClearUserCoolDown(id)         if(IsUserAllowed(id))     {         client_cmd(id, "cl_bob 0.01")                 ClearUserAllowed(id)     } } public event_new_round() {     flSprintSpeedAdder = get_pcvar_float(cvar_sprintspeedadder)     flSprintMaxDuration = get_pcvar_float(cvar_sprintmaxduration)     flMinTimeForSoundEffect = get_pcvar_float(cvar_mintimeforsoundeffect)         for(new i = 0; i < iMaxPlayers; i++)     {         ClearUserSprinting(i)         ClearUserCoolDown(i)                 if(IsUserAllowed(i))             client_cmd(i, "cl_bob 0.01")     } } public event_DeathMsg() {     new iVictim = read_data(2)         ClearUserAlive(iVictim)     ClearUserSprinting(iVictim)     ClearUserCoolDown(iVictim)         if(IsUserAllowed(iVictim))         client_cmd(iVictim, "cl_bob 0.01") } public event_CurWeapon(id) {     if(~IsUserAlive(id) || !zp_core_is_zombie(id))         return PLUGIN_CONTINUE             iCurWeapon[id] = read_data(2)         return PLUGIN_CONTINUE } public fw_PlayerPreThink(id) {     if(~IsUserAlive(id) || !zp_core_is_zombie(id))         return FMRES_IGNORED             if(IsUserSprinting(id))         cs_set_user_sprint_speed(id)             return FMRES_IGNORED } public zp_fw_core_spawn_post(id) {     if(!is_user_alive(id))         return PLUGIN_CONTINUE             MarkUserAlive(id)     ClearUserSprinting(id)     ClearUserCoolDown(id)         if(IsUserAllowed(id))         client_cmd(id, "cl_bob 0.01")         return PLUGIN_CONTINUE } public command_sprint(id) {     if(~IsUserAlive(id) || !zp_core_is_zombie(id) || IsUserCoolDown(id))         return PLUGIN_CONTINUE             if(IsUserSprinting(id))     {         ClearUserSprinting(id)                 if(IsUserAllowed(id))             client_cmd(id, "cl_bob 0.01")                     if(flSprintDuration[id] >= flMinTimeForSoundEffect)             client_cmd(id, "spk %s", BREATHING_SOUND)                 set_task(flSprintDuration[id], "reset_vars", id)     }     else     {         new IsDucking = (pev(id, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND))                 if(!IsDucking)         {             MarkUserSprinting(id)                         if(IsUserAllowed(id))                 client_cmd(id, "cl_bob 0.05")                             set_task(0.25, "hook_sprint_duration", id)         }     }         return PLUGIN_CONTINUE } public hook_sprint_duration(id) {     if(~IsUserAlive(id) || !zp_core_is_zombie(id) || ~IsUserSprinting(id))         return PLUGIN_CONTINUE             new IsDucking = (pev(id, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND))         if(IsDucking)     {         ClearUserSprinting(id)                 if(IsUserAllowed(id))             client_cmd(id, "cl_bob 0.01")                     MarkUserCoolDown(id)                 if(flSprintDuration[id] >= flMinTimeForSoundEffect)             client_cmd(id, "spk %s", BREATHING_SOUND)                 set_task(flSprintDuration[id], "reset_vars", id)                     return PLUGIN_CONTINUE     }             flSprintDuration[id] += 0.25         if(flSprintDuration[id] >= flSprintMaxDuration)     {         ClearUserSprinting(id)                 if(IsUserAllowed(id))             client_cmd(id, "cl_bob 0.01")                     MarkUserCoolDown(id)                 if(flSprintDuration[id] >= flMinTimeForSoundEffect)             client_cmd(id, "spk %s", BREATHING_SOUND)                 set_task(flSprintDuration[id], "reset_vars", id)     }         set_task(0.25, "hook_sprint_duration", id)         return PLUGIN_CONTINUE } public reset_vars(id) {     client_cmd(id, "stopsound")         if(~IsUserAlive(id))         return PLUGIN_CONTINUE             ClearUserCoolDown(id)     flSprintDuration[id] = 0.0         return PLUGIN_CONTINUE } public menu_permission(id) {     new menu = menu_create("\yDo you allow ^"Sprint^" plugin to edit your CVar for realism?", "menu_handler")         menu_additem(menu, "\wYes", "1", 0)     menu_additem(menu, "\wNo", "2", 0)         menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)     menu_display(id, menu, 0) } public menu_handler(id, menu, item) {     if(item == MENU_EXIT)     {         menu_destroy(menu)         return PLUGIN_HANDLED     }         new data[6], szName[64]     new access, callback         menu_item_getinfo(menu, item, access, data, charsmax(data), szName,charsmax(szName), callback)         new key = str_to_num(data)         switch(key)     {         case 1:         {             MarkUserAllowed(id)                         client_print(id, print_chat, "[Sprint] Sprint realism is now enabled.")             client_print(id, print_chat, "[Sprint] Open up your console(~) and bind a key to sprint. e.g. bind v sprint")                         menu_destroy(menu)             return PLUGIN_HANDLED         }         case 2:         {             ClearUserAllowed(id)                         client_cmd(id, "cl_bob 0.01")                         client_print(id, print_chat, "[Sprint] Sprint realism is now disabled.")                         menu_destroy(menu)             return PLUGIN_HANDLED         }     }         menu_destroy(menu)     return PLUGIN_HANDLED } stock cs_set_user_sprint_speed(id) {     new Float:flMaxSpeed         switch(iCurWeapon[id])     {         case CSW_SG550, CSW_AWP, CSW_G3SG1 : flMaxSpeed = (210.0 + flSprintSpeedAdder)         case CSW_M249 : flMaxSpeed = (220.0 + flSprintSpeedAdder)         case CSW_AK47 : flMaxSpeed = (221.0 + flSprintSpeedAdder)         case CSW_M3, CSW_M4A1 : flMaxSpeed = (230.0 + flSprintSpeedAdder)         case CSW_SG552 : flMaxSpeed = (235.0 + flSprintSpeedAdder)         case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS : flMaxSpeed = (240.0 + flSprintSpeedAdder)         case CSW_P90 : flMaxSpeed = (245.0 + flSprintSpeedAdder)         case CSW_SCOUT : flMaxSpeed = (260.0 + flSprintSpeedAdder)         default : flMaxSpeed = (250.0 + flSprintSpeedAdder)     }         set_user_maxspeed(id, flMaxSpeed) }

Note: This is an edit base on my Basic Scripting plugin

Also, players have to manually bind a button to "sprint". Example: bind v sprint

EDIT: For the sound, go to the thread and download it.
Quote:
Originally Posted by JoKeR LauGh View Post
Code:
#include <amxmodx> #include <fun> #include <fakemeta> #include <zp50_core> #include <zp50_class_nemesis> #include <zp50_class_zombie> #include <zp50_colorchat> #include <zp50_colorchat_const> new g_zclass_sprint new const zclass_name[] = "Sprinter" new const zclass_desc[] = "Press R to sprint" new const zclass_model[] = "zombie_source" new const zclass_claw[] = "models/zombie_plague/v_knife_zombie.mdl" const zclass_health = 1400 const Float:zclass_speed = 1.0 const Float:zclass_gravity = 1.0 const Float:zclass_knockback = 1.0 new cvar_run public plugin_precache() {     g_zclass_sprint = zp_class_zombie_register(zclass_name, zclass_desc, zclass_health, zclass_speed, zclass_gravity)         new index         zp_class_zombie_register_kb(g_zclass_sprint, zclass_knockback)         for (index = 0; index < sizeof zclass_model; index++)             zp_class_zombie_register_model(g_zclass_sprint, zclass_model[index])             for (index = 0; index < sizeof zclass_claw; index++)             zp_class_zombie_register_claw(g_zclass_sprint, zclass_claw[index]) } public plugin_init() {     register_plugin("[ZP] Zclass Runner", "0.1", "ZP Member")         register_forward(FM_CmdStart, "CmdRun")         cvar_run = register_cvar("Run Speed", "300") } public zp_fw_class_zombie_select_pre(id, classid) {     if ( classid == g_zclass_sprint )     {         zp_colored_print(id, "^x04[ZP]^x01 You have chosen ^x04%s^x01 , Press ^x04R^x01 to ^x04Sprint^x01!", zclass_name)     } } public CmdRun(id, uc_handle, seed) {     if(!is_user_alive(id)) return FMRES_IGNORED;     {         if ( zp_class_nemesis_get(id) ) return;         if ( zp_class_zombie_get_current(id) == g_zclass_sprint )         {             if(pev(id, pev_button) & IN_RELOAD && !(pev(id, pev_oldbuttons) & IN_RELOAD))             {                 CmdRunStart(id)             }         }     }                 return FMRES_IGNORED } public CmdRunStart(id) {     if (is_user_alive(id))     {         set_user_maxspeed(id, get_pcvar_float ( cvar_run ) )     } }
FOR EXCALIBUR: Its an addon

FOR JoKeR-LauGh: Thanks man. OFF-TOPIC: PLease accept me as friends
__________________
Isaac999 is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-12-2011 , 02:07   Re: (request) Zombie run with reload key
Reply With Quote #20

Anyway, the codes are old. I've rewrote the sprint and updated the thread. The new version works a lot better.
Excalibur.007 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode