Raised This Month: $ Target: $400
 0% 

Slowing Down Players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
LordDeath
Member
Join Date: Feb 2019
Old 08-10-2019 , 19:30   Slowing Down Players
Reply With Quote #1

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);
	}
}
LordDeath is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode