Raised This Month: $ Target: $400
 0% 

Help with slay after speed > 2x


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
srx
New Member
Join Date: Jan 2005
Old 01-07-2005 , 13:03   Help with slay after speed > 2x
Reply With Quote #1

Hi, im not quite sure f its possible, but can never know the limits of amx scripting. would it be possible to slay each person that reaches a forward speed of say 2x. im not quite sure what the max speed is thats possible ingame. possibly around 1.3? just wondering as it would stop speed hacking on our servers.

an example would be great thanks.

regards srx
srx is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-07-2005 , 15:59  
Reply With Quote #2

Well, this code would be a start:

Code:
#include <amxmodx> #include <engine>  public check_speed(id) {    if(is_user_alive(id)) {      if(get_speed(id) > get_cvar_num("sv_maxspeed")) {        server_cmd("amx_slay #%d",id);      }    }  }

However, deciding when to call it would be tricky. You could call it on a client prethink, but it might cause a bit of lag. You could set a task for every player that is run every X seconds, but that might not catch everyone.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
srx
New Member
Join Date: Jan 2005
Old 01-07-2005 , 17:30  
Reply With Quote #3

mmmm i see. how laggy do you think it would get say checking every 5 - 10 seconds? seems as a good idea may not be quite as good any more >.<

thanks for your help avalanche
srx is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-07-2005 , 20:00  
Reply With Quote #4

Code:
#include <amxmodx> #include <engine> public check_speed(id) {    if(is_user_alive(id) && get_cvar_num("sv_speedcheck") >= 1) {      if(get_speed(id) > get_cvar_num("sv_maxspeed")) {        server_cmd("amx_slay #%d",id);      }    }    set_task(get_cvar_float("sv_speedcheckrate"),"check_speed",id); } public client_putinserver(id) {   set_task(get_cvar_float("sv_speedcheckrate"),"check_speed",id); } public client_disconnect(id) {   remove_task(id); } public plugin_init() {   register_plugin("Speed Slayer","0.10","Avalanche");   register_cvar("sv_speedcheck","1");   register_cvar("sv_speedcheckrate","5.0"); }

This will theoretically work, but it hasn't been tested. sv_speedcheck (0 or 1) will turn the plugin on or off, and sv_speedcheckrate will determine the rate at which it checks.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply



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 19:22.


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