Raised This Month: $51 Target: $400
 12% 

Suggestion / Subplugin Request Dont leap in duck


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 04-16-2015 , 23:13   Dont leap in duck
Reply With Quote #1

Hi everybody, well i use this zombie class made by yokomo (leaper) work fine but can someone block the leap when zombies is in duck, I mean not use leap when is in duck only when standing... thx in advance

Code:

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>

new const zclass_name[] = {"Leap Zombie"
new const 
zclass_info[] = {"Leap Ability"
new const 
zclass_model[] = {"zombie_source"
new const 
zclass_clawmodel[] = {"v_knife_zombie.mdl"}
const 
zclass_health 4500 
const zclass_speed 269 
const Float:zclass_gravity 0.7 
const Float:zclass_knockback 1.3 

new CvrLeapForwardCvrLeapUpwardCvrLeapCooldowniZmClassLeaperbool:bIsLeaper[33], Float:fLastLeap[33], iMaxClients

public plugin_precache()
{
    
iZmClassLeaper zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)     
}

public 
plugin_init()
{
    
register_plugin("ZP ZmClass Leaper""0.0.1""wbyokomo")
    
    
register_event("HLTV""OnNewRound""a""1=0""2=0")
    
    
RegisterHam(Ham_Killed"player""OnPlayerKilled")
    
RegisterHam(Ham_Player_Jump"player""OnPlayerJump")
    
    
CvrLeapForward register_cvar("zp_class_leap_forward""600")
    
CvrLeapUpward register_cvar("zp_class_leap_upward""300.0")
    
CvrLeapCooldown register_cvar("zp_class_leap_cooldown""5.0")
    
iMaxClients get_maxplayers()
}

public 
OnNewRound()
{
    new 
j
    
for(j=1;j<=iMaxClients;j++)
    {
        if(
is_user_connected(j)) bIsLeaper[j] = false;
    }
}

public 
OnPlayerKilled(id)
{
    
bIsLeaper[id] = false
}

public 
zp_user_infected_post(id)
{
    
bIsLeaper[id] = false
    
if(zp_get_user_nemesis(id)) return;
    if(
zp_get_user_zombie_class(id) != iZmClassLeaper) return;
    
    
bIsLeaper[id] = true
    client_print
(idprint_chat"[ZP] Your ability is Long-Jump. Cooldown: %.1f secs."get_pcvar_float(CvrLeapCooldown))
}

public 
zp_user_humanized_post(id)
{
    
bIsLeaper[id] = false
}

public 
OnPlayerJump(id)
{
    if(!
bIsLeaper[id]) return; //not a leaper zombie
    
static Float:ctimectime get_gametime();
    if(
fLastLeap[id] > ctime) return; //in cooldown
    
if(pev(idpev_maxspeed) < 2.0) return; //frozen or in freezetime
    
if(!(pev(idpev_flags) & FL_ONGROUND)) return; //not on the ground
    
if(!(pev(idpev_button) & IN_DUCK)) return; //not press duck button
    
    //ok can leap
    
fLastLeap[id] = ctime+get_pcvar_float(CvrLeapCooldown)
    new 
Float:fVelocity[3]
    
velocity_by_aim(idget_pcvar_num(CvrLeapForward), fVelocity)
    
fVelocity[2] = get_pcvar_float(CvrLeapUpward)
    
set_pev(idpev_velocityfVelocity)


Last edited by wicho; 04-16-2015 at 23:32.
wicho is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 04-17-2015 , 06:17   Re: Dont leap in duck
Reply With Quote #2

tried this?
PHP Code:
if(pev(idpev_flags) & FL_ONGROUND && pev(idpev_flags) & FL_DUCKING) return; 

Last edited by safetymoose; 04-17-2015 at 06:21.
safetymoose is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 04-17-2015 , 08:07   Re: Dont leap in duck
Reply With Quote #3

LOL i didn't remember that i made this class. Well you can try what safetymoose suggest. Maybe it work.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 04-18-2015 , 10:55   Re: Dont leap in duck
Reply With Quote #4

wait, so what's the point of having a leap if you dont want to use it in tunnels for bhop? This zombie already has double jump, so it doesnt need leap to chase humans outside. They jump like crazy, do air strafes with double jumps + parachutes...
safetymoose is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 05-04-2015 , 20:06   Re: Dont leap in duck
Reply With Quote #5

PHP Code:
if(!(pev(idpev_button) & IN_DUCK)) return; //not press duck button 

PHP Code:
if((pev(idpev_button) & IN_DUCK)) return; //not press duck button 

Last edited by Krtola; 05-04-2015 at 20:06.
Krtola is offline
Send a message via Skype™ to Krtola
Reply



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 03:38.


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