I want to slow the down the players, in other words, to force them to remain under 400. (SGS users)
I ended up getting them to stop instead of slowing down a bit, what's wrong in the code?
I assume this is the part which is done wrong, but I have no clue what I should do.
HTML Code:
set_pev(id, pev_velocity, speed);
Full code :
HTML Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
//#include <zp50_grenade_frost> ;Not used yet
#define PLUGIN "Sgs Limiter"
#define VERSION "1.0"
#define AUTHOR "Death"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_CmdStart, "fw_Start")
}
public fw_Start(id, uc_handle, seed)
{
new button = get_uc(uc_handle,UC_Buttons)
if((button & IN_DUCK))
check_speed(id)
}
public check_speed(id)
{
new Float:speed[3];
pev(id, pev_velocity, speed);
if(speed[2] > 400 || speed[1] > 400 || speed[0] > 400)
{
set_pev(id, pev_velocity, speed);
//set_pev(id, pev_velocity, speed - 10);
}
}