Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <reapi>
- new last_stand[33],Float:duck_start_time[33]
- public plugin_init() {
- register_plugin("Anti DD Scroll", "Test", "Test");
- RegisterHookChain(RG_CBasePlayer_Duck, "RG_Duck");
- register_cvar("adds_version", "1.0", FCVAR_SERVER | FCVAR_SPONLY);
- }
- public RG_Duck(id)
- {
- new button = get_entvar(id, EntVars:var_button); // get_user_button(id)
- new oldbutton = get_entvar(id, EntVars:var_oldbuttons); // get_user_oldbutton(id)
- if(button & IN_DUCK)
- {
- if(last_stand[id])
- {
- duck_start_time[id] = get_gametime();
- last_stand[id] = false;
- }
- }
- else if(oldbutton & IN_DUCK)
- {
- if(!last_stand[id])
- {
- new Float:fGameTime = get_gametime()
- // So low time, this is scroll for sure, block duck.
- if((fGameTime-duck_start_time[id])<0.018)
- {
- new Float:vVeloc[3];
- get_entvar(id, var_velocity, vVeloc);
- vVeloc[0] = vVeloc[0]/2;
- vVeloc[1] = vVeloc[1]/2;
- set_entvar(id, var_velocity, vVeloc);
- }
- }
- last_stand[id] = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement