Raised This Month: $ Target: $400
 0% 

Changing IN_ATTACK


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kmal2t
BANNED
Join Date: Apr 2006
Old 05-22-2007 , 15:50   Changing IN_ATTACK
Reply With Quote #1

<See my last post>

Last edited by kmal2t; 05-24-2007 at 02:41.
kmal2t is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 05-22-2007 , 19:23   Re: Changing IN_ATTACK
Reply With Quote #2

Code:
... &= ~IN_ATTACK2
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Old 05-22-2007, 20:10
kmal2t
This message has been deleted by kmal2t.
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 05-22-2007 , 22:23   Re: Changing IN_ATTACK
Reply With Quote #3

Probably needs . (... &= ~IN_ATTACK2)...
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Old 05-22-2007, 23:30
kmal2t
This message has been deleted by kmal2t.
_Master_
Senior Member
Join Date: Dec 2006
Old 05-23-2007 , 14:05   Re: Changing IN_ATTACK
Reply With Quote #4

In plugin_init():
PHP Code:
register_forward(FM_CmdStart"FM_Cmd_Start"
Somewhere in your code:
PHP Code:
public FM_Cmd_Start(iduc_handletrash){
    new 
button get_uc(uc_handleUC_Buttons)
    
    if(
button IN_ATTACK2){
        
        
set_uc(uc_handleUC_Buttonsbutton & ~IN_ATTACK2)
        return 
FMRES_IGNORED
    
}
    
    return 
FMRES_HANDLED

_Master_ is offline
Old 05-23-2007, 14:22
kmal2t
This message has been deleted by kmal2t.
_Master_
Senior Member
Join Date: Dec 2006
Old 05-23-2007 , 14:28   Re: Changing IN_ATTACK
Reply With Quote #5

It did when I used it.
_Master_ is offline
Old 05-23-2007, 14:34
kmal2t
This message has been deleted by kmal2t.
_Master_
Senior Member
Join Date: Dec 2006
Old 05-23-2007 , 14:44   Re: Changing IN_ATTACK
Reply With Quote #6

Just to make sure...
You edited that code and added IN_ATTACK to the UC_Button field right ?
_Master_ is offline
Old 05-23-2007, 15:10
kmal2t
This message has been deleted by kmal2t.
Old 05-23-2007, 21:22
kmal2t
This message has been deleted by kmal2t.
Zenith77
Veteran Member
Join Date: Aug 2005
Old 05-23-2007 , 22:10   Re: Changing IN_ATTACK
Reply With Quote #7

There is a complete tutorial on how to block client side animations and attacks. Please search in the Code Snippets/Tutorials sections. Your answer lies there.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 05-24-2007 , 00:50   Re: Changing IN_ATTACK
Reply With Quote #8

This is not the code I gave you.
PHP Code:
public CmdStart(iduc_handletrash) { 
    new 
button get_uc(uc_handleUC_Buttons)
    if( (
button IN_ATTACK2) && (read_data(2) == 20) ) {
        
set_uc(uc_handleUC_Buttonsbutton &= IN_CANCEL)
    }
    return 
FMRES_HANDLED 

You cannot use read_data() here. Use get_user_weapon() to get the weapon ID.
Also I can't figure out why you did this
PHP Code:
set_uc(uc_handleUC_Buttonsbutton &= IN_CANCEL
_Master_ is offline
Old 05-24-2007, 02:22
kmal2t
This message has been deleted by kmal2t.
kmal2t
BANNED
Join Date: Apr 2006
Old 05-25-2007 , 23:13   Re: Changing IN_ATTACK
Reply With Quote #9

Does anyone know a method to block the clientside stuff but only for attack2 ? Its blocking the attack2 from actually firing but when I try to stop the attack2 client-side stuff it's either not blocking it or blocking the attack1 stuff too. :\
Code:
#include <amxmodx> #include <fakemeta> new bool:allowattack new bool:onGun public plugin_init() {     register_plugin("PLUGIN", "VERSION", "AUTHOR")     //register_forward(FM_PlayerPreThink, "FM_pthink")     register_forward(FM_CmdStart, "FM_Cstart")     register_forward(FM_UpdateClientData, "FM_UCD", 1) } public FM_UCD(id, sendweapons, cd_handle) {     if( (onGun == false) || (allowattack == true) ) {         return FMRES_IGNORED     }     else {         set_cd(cd_handle, CD_ID, 0)     }     return FMRES_HANDLED; } public FM_Cstart(id, uc_handle, trash){     if(is_user_alive(id)) {         allowattack = true         onGun = false         new ammo, clip, weapon = get_user_weapon(id,clip,ammo)         if( (get_team_int(id) == 1) && (weapon == 20) ) {             onGun = true             if( ( get_uc(uc_handle, UC_Buttons) & IN_ATTACK2) ) {                 allowattack = false                 set_uc(uc_handle, UC_Buttons, get_uc(uc_handle, UC_Buttons) & ~IN_ATTACK2)             }         }     }     return FMRES_HANDLED } stock get_team_int(id) {     new TeamString[8];     get_user_team(id,TeamString,7)     if(equali(TeamString,"SLAYER"))         return 1;     if(equali(TeamString,"VAMPIRE"))         return 2;     return 0; }

Last edited by kmal2t; 05-25-2007 at 23:16.
kmal2t is offline
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 10:40.


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