Raised This Month: $ Target: $400
 0% 

Forcing a zombie to duck and may not jump


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-09-2009 , 09:45   Forcing a zombie to duck and may not jump
Reply With Quote #1

I trying to force a zombie to duck and may not jump

PHP Code:
#include <hamsandwich> 
PHP Code:
RegisterHam(Ham_Player_PreThink"player""fwd_Player_PreThink"
PHP Code:
public fwd_Player_PreThink(id)
{
    if (!
zp_get_user_zombie(id) || zp_get_user_nemesis(id))
   
HAM_IGNORED
    
if (zp_get_user_zombie_class(id) != g_zclass_hczombie)
  
HAM_IGNORED
    set_pev
(idpev_oldbuttonspev(idpev_oldbuttons)|IN_JUMP|IN_DUCK)
    {
        return 
HAM_SUPERCEDE 
    

    return 
HAM_IGNORED 

but it didn't work.
__________________
ƒa†es™ is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 06-09-2009 , 11:01   Re: Forcing a zombie to duck and may not jump
Reply With Quote #2

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <zombieplague>

#define PLUGIN "Nowy Plugin"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

/*new g_zclass_hczombie = 0;*/

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_CmdStart"FwdCmdStart")
    
register_forward(FM_PlayerPreThink"FwdClientPreThink")
    
}

public 
FwdClientPreThink(id)
{
    if(!
zp_get_user_zombie(id) || zp_get_user_nemesis(id) || !is_user_alive(id) || zp_get_user_zombie_class(id) != g_zclass_hczombie
        return 
FMRES_IGNORED
    
    set_pev
(idpev_buttonpev(idpev_button) & IN_DUCK)    
    
    return 
FMRES_IGNORED
}


public 
FwdCmdStart(iduc_handleseed)
{
    if(!
is_user_alive(id) || !zp_get_user_zombie(id))
        return 
FMRES_IGNORED
    
    
new button get_uc(uc_handleUC_Buttons)
    if(
button IN_JUMP)
    {
        
set_uc(uc_handleUC_Buttons, (button & ~IN_JUMP))
        
        return 
FMRES_SUPERCEDE
    
}    
    return 
FMRES_IGNORED

try this.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 06-09-2009 , 12:58   Re: Forcing a zombie to duck and may not jump
Reply With Quote #3

pev_bInDuck?
SnoW is offline
Send a message via MSN to SnoW
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-09-2009 , 13:07   Re: Forcing a zombie to duck and may not jump
Reply With Quote #4

Quote:
Originally Posted by Sn!ff3r View Post
PHP Code:
/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <zombieplague>
 
#define PLUGIN "Nowy Plugin"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"
 
/*new g_zclass_hczombie = 0;*/
 
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_CmdStart"FwdCmdStart")
    
register_forward(FM_PlayerPreThink"FwdClientPreThink")
 
}
 
public 
FwdClientPreThink(id)
{
    if(!
zp_get_user_zombie(id) || zp_get_user_nemesis(id) || !is_user_alive(id) || zp_get_user_zombie_class(id) != g_zclass_hczombie
        return 
FMRES_IGNORED
 
    set_pev
(idpev_buttonpev(idpev_button) & IN_DUCK)    
 
    return 
FMRES_IGNORED
}
 
 
public 
FwdCmdStart(iduc_handleseed)
{
    if(!
is_user_alive(id) || !zp_get_user_zombie(id))
        return 
FMRES_IGNORED
 
    
new button get_uc(uc_handleUC_Buttons)
    if(
button IN_JUMP)
    {
        
set_uc(uc_handleUC_Buttons, (button & ~IN_JUMP))
 
        return 
FMRES_SUPERCEDE
    
}    
    return 
FMRES_IGNORED

try this.
Didn't work.

Quote:
Originally Posted by SnoW View Post
pev_bInDuck?
How ?
__________________
ƒa†es™ is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-09-2009 , 15:34   Re: Forcing a zombie to duck and may not jump
Reply With Quote #5

I'm not sure what you want. You want zombie to duck and disallow him to jump? If so, you can try this (not tested and I doubt that it will work flawlessly).
Code:
public FwdCmdStart(id, uc_handle, seed) {         if(!is_user_alive(id) || !zp_get_user_zombie(id))                 return FMRES_IGNORED           static Buttons, DoAction;         Buttons = get_uc(uc_handle, UC_Buttons);           if (!(Buttons & IN_DUCK))         {                 DoAction = true;                 Buttons |= IN_DUCK;         }           if (Buttons & IN_JUMP)         {                 DoAction = true;                 Buttons |= ~IN_JUMP;         }           if (DoAction)         {                 set_uc(uc_handle, UC_Buttons, Buttons);                   return FMRES_SUPERCEDE;         }           return FMRES_IGNORED; }
__________________
hleV is offline
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-10-2009 , 02:02   Re: Forcing a zombie to duck and may not jump
Reply With Quote #6

Quote:
Originally Posted by hleV View Post
I'm not sure what you want. You want zombie to duck and disallow him to jump? If so, you can try this (not tested and I doubt that it will work flawlessly).

Code:
public FwdCmdStart(id, uc_handle, seed)</p><p>{</p><p> if(!is_user_alive(id) || !zp_get_user_zombie(id))</p><p> return FMRES_IGNORED</p><p>&nbsp;</p><p> static Buttons, DoAction;</p><p> Buttons = get_uc(uc_handle, UC_Buttons);</p><p>&nbsp;</p><p> if (!(Buttons & IN_DUCK))</p><p> {</p><p> DoAction = true;</p><p> Buttons |= IN_DUCK;</p><p> }</p><p>&nbsp;</p><p> if (Buttons & IN_JUMP)</p><p> {</p><p> DoAction = true;</p><p> Buttons |= ~IN_JUMP;</p><p> }</p><p>&nbsp;</p><p> if (DoAction)</p><p> {</p><p> set_uc(uc_handle, UC_Buttons, Buttons);</p><p>&nbsp;</p><p> return FMRES_SUPERCEDE;</p><p> }</p><p>&nbsp;</p><p> return FMRES_IGNORED;</p><p>}

Didn't work

When i jump it auto attack
__________________
ƒa†es™ 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 13:51.


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