hey,
i don't want players to duck on entitys like func_rotating, func_door_rotating..
i wrote some code which already works but it just blocks your duck if your on the entity, if you jump and duck in jump and land on the entity in duck you won't stand up but still ducking...
i tried set_pev(id, pev_bInDuck, 0) or client_cmd(id,"-duck") but you can still duck on these entitys if you duck before in air...
heres my code
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN "Deathrun_Anti-Duck-Bug"
#define VERSION "1.0"
#define AUTHOR "ulmax"
//--------------------------------------------------------------------------------------------------
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)
}
}
}
}
//--------------------------------------------------------------------------------------------------