workaround :
Ask player if they allow your plugin to change their vars :
cl_forwardspeed, cl_backspeed, cl_sidespeed
If player say yes, change vars to sv_maxspeed value
Else, do what you want, kick of let them play.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Duck Speed"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"
#define FACTOR 2.35
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_PlayerPreThink, "PlayerPreThink")
set_cvar_float("sv_maxspeed", 610.0)
}
public PlayerPreThink(id)
{
if( pev(id, pev_button) & IN_DUCK )
{
if( !(pev(id, pev_oldbuttons) & IN_DUCK) )
{
cs_set_user_duckspeed(id)
}
}
else
{
if( pev(id, pev_oldbuttons) & IN_DUCK )
{
cs_reset_user_maxspeed(id)
}
}
}
stock cs_reset_user_maxspeed(id)
{
new Float:flMaxSpeed;
switch ( get_user_weapon(id) )
{
case CSW_SG550, CSW_AWP, CSW_G3SG1 : flMaxSpeed = 210.0;
case CSW_M249 : flMaxSpeed = 220.0;
case CSW_AK47 : flMaxSpeed = 221.0;
case CSW_M3, CSW_M4A1 : flMaxSpeed = 230.0;
case CSW_SG552 : flMaxSpeed = 235.0;
case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS : flMaxSpeed = 240.0;
case CSW_P90 : flMaxSpeed = 245.0;
case CSW_SCOUT : flMaxSpeed = 260.0;
default : flMaxSpeed = 250.0;
}
engfunc(EngFunc_SetClientMaxspeed, id, flMaxSpeed);
set_pev(id, pev_maxspeed, flMaxSpeed);
}
stock cs_set_user_duckspeed(id)
{
new Float:flMaxSpeed;
switch ( get_user_weapon(id) )
{
case CSW_SG550, CSW_AWP, CSW_G3SG1 : flMaxSpeed = 210.0*FACTOR;
case CSW_M249 : flMaxSpeed = 220.0*FACTOR;
case CSW_AK47 : flMaxSpeed = 221.0*FACTOR;
case CSW_M3, CSW_M4A1 : flMaxSpeed = 230.0*FACTOR;
case CSW_SG552 : flMaxSpeed = 235.0*FACTOR;
case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS : flMaxSpeed = 240.0*FACTOR;
case CSW_P90 : flMaxSpeed = 245.0*FACTOR;
case CSW_SCOUT : flMaxSpeed = 260.0*FACTOR;
default : flMaxSpeed = 250.0*FACTOR;
}
engfunc(EngFunc_SetClientMaxspeed, id, flMaxSpeed);
set_pev(id, pev_maxspeed, flMaxSpeed);
}
__________________