Oh wow it works now
Thanks to minimiller for client_cmd("WAIT;-duck") ..
The wait was the thing i forgot , now it works properly
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN "Deathrun_Anti-Duck-Bug"
#define VERSION "1.0"
#define AUTHOR "ulmax"
#define OFFSET_DUCKTIME 262
#define LINUXDIFF 5
//--------------------------------------------------------------------------------------------------
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_PlayerPreThink,"fwThink");
}
//--------------------------------------------------------------------------------------------------
public fwThink(id) {
if(is_user_alive(id) && (pev(id,pev_button) & IN_DUCK)) {
if(pev(id,pev_groundentity) > 32) {
new cname[32];
pev(pev(id,pev_groundentity),pev_classname,cname,31);
if(containi(cname,"rotating") > 0) {
set_pev(id, pev_oldbuttons, pev(id, pev_oldbuttons) | IN_DUCK)
//set_pev(id, pev_button, pev(id, pev_button) | IN_DUCK)
client_cmd(id,"wait;-duck");
}
}
}
}
//--------------------------------------------------------------------------------------------------
One thing left any chance to check if they are in duck if they are on the rotating so i do not have to spam -duck ?
i tried making an if statement checking bInDuck, PhysicsFlags, fDuckTime and some other shit but it didn't work ...
Is this bad if it spams -duck so often?