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;
}