AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Changing IN_ATTACK (https://forums.alliedmods.net/showthread.php?t=55474)

kmal2t 05-22-2007 15:50

Changing IN_ATTACK
 
<See my last post>

teame06 05-22-2007 19:23

Re: Changing IN_ATTACK
 
Code:
... &= ~IN_ATTACK2

teame06 05-22-2007 22:23

Re: Changing IN_ATTACK
 
Probably needs . (... &= ~IN_ATTACK2)...

_Master_ 05-23-2007 14:05

Re: Changing IN_ATTACK
 
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_ 05-23-2007 14:28

Re: Changing IN_ATTACK
 
It did when I used it.

_Master_ 05-23-2007 14:44

Re: Changing IN_ATTACK
 
Just to make sure...
You edited that code and added IN_ATTACK to the UC_Button field right ?

Zenith77 05-23-2007 22:10

Re: Changing IN_ATTACK
 
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.

_Master_ 05-24-2007 00:50

Re: Changing IN_ATTACK
 
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


kmal2t 05-25-2007 23:13

Re: Changing IN_ATTACK
 
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; }


All times are GMT -4. The time now is 10:40.

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