Raised This Month: $51 Target: $400
 12% 

Simple plugin not working.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 08-16-2005 , 13:05   Simple plugin not working.
Reply With Quote #1

On SuperHero Mod, with the hero "accelerator" you can use cl_forwardspeed 9999 to run much faster than accelerator really should.

And many are abusing this in my server.
So I made a plugin to prevent this.

But it aint working.
It changes the cl_speeds to default when they connect, but they can still change it.

Whats wrong here?
Code:
#include <amxmodx> #include <amxmisc> #define ACCESS_LEVEL ADMIN_IMMUNITY public plugin_init() {     register_plugin("No CL Speed Bug", "1.0", "XunTric")     register_clcmd("cl_forwardspeed", "cl_speeds")     register_clcmd("cl_backspeed", "cl_speeds")     register_clcmd("cl_sidespeed", "cl_speeds") } public cl_speeds(id) {     if(get_cvar_num("amx_adminclspeeds") >= 1) {                if((get_user_flags(id) & ACCESS_LEVEL)) {               return PLUGIN_HANDLED          }     }     client_print(id, print_console, "[SH] Using the cl_speed bug is not allowed in this server!")     client_cmd(id, "cl_forwardspeed 400")     client_cmd(id, "cl_backspeed 400")     client_cmd(id, "cl_sidespeed 400")         return PLUGIN_HANDLED } public client_connect(id) {     client_cmd(id, "cl_forwardspeed 400")     client_cmd(id, "cl_backspeed 400")     client_cmd(id, "cl_sidespeed 400")         return PLUGIN_HANDLED }
XunTric is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-16-2005 , 13:21  
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> #define ACCESS_LEVEL ADMIN_IMMUNITY public plugin_init()     {     register_plugin("No CL Speed Bug", "1.0", "XunTric")         register_clcmd("cl_forwardspeed", "cl_speeds")     register_clcmd("cl_backspeed", "cl_speeds")     register_clcmd("cl_sidespeed", "cl_speeds") } public cl_speeds(id)     {     if(get_cvar_num("amx_adminclspeeds") >= 1) {                 if((get_user_flags(id) & ACCESS_LEVEL)) {             return PLUGIN_HANDLED         }     }         client_print(id, print_console, "[SH] Using the cl_speed bug is not allowed in this server!")         client_cmd(id, "cl_forwardspeed 400")     client_cmd(id, "cl_backspeed 400")     client_cmd(id, "cl_sidespeed 400")         return PLUGIN_HANDLED } public client_putinserver(id)     {     set_task(1.0,"client_connect",id,_,_,"b")     return PLUGIN_HANDLED } public client_connect(id)     {     client_cmd(id, "cl_forwardspeed 400")     client_cmd(id, "cl_backspeed 400")     client_cmd(id, "cl_sidespeed 400")         return PLUGIN_HANDLED }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 08-16-2005 , 13:43  
Reply With Quote #3

Thanks for help, but that was not what I ment.

The cl_ speeds sets to default when they connect.
That works.

But, they can still change it after they connect.

(Btw, I know the cvar in the code isnt registered... Just forgot it thehe)
XunTric is offline
xx_sirhc_xx
Member
Join Date: Jul 2005
Old 08-16-2005 , 14:03  
Reply With Quote #4

Code:
         if((get_user_flags(id) & ACCESS_LEVEL)) {               return PLUGIN_HANDLED

you're not allowing admin to change. even though yours doesn't work, when you get it working, you'll want..

Code:
         if((get_user_flags(id) & ACCESS_LEVEL)) {               return PLUGIN_CONTINUE
xx_sirhc_xx is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 08-16-2005 , 15:52  
Reply With Quote #5

Ouch, ok thanks

Anybody know why players still can change the cl_ speeds?
XunTric is offline
ephexx
Junior Member
Join Date: Aug 2005
Old 08-16-2005 , 16:14  
Reply With Quote #6

no clue, but ur server is the shit
ephexx is offline
Send a message via AIM to ephexx
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-16-2005 , 17:44  
Reply With Quote #7

Use the client_infochanged() forward.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-16-2005 , 19:22  
Reply With Quote #8

cl_forwardspeed is a client command, hence cl_, so it probably wouldn't be sent to the server, which means AMXx can't intercept it. Also, client_infochanged is only called when a client changes "info", data available when you use the command "setinfo", so I don't think that will work either.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
VanillA Ice
Senior Member
Join Date: Apr 2005
Old 08-16-2005 , 20:13  
Reply With Quote #9

or you could jsut do this....


Code:
public plugin_init() {      //yada yada yada      register_clientcmd("cl_speed", "block_command") } public block_command(id) {                    client_print(id, print_chat, "[SH] You are not allowed to use that command due to abuse protection!")                   client_print(id, print_console,"[SH] You are not allowed to use that command due to abuse protection!")           return PLUGIN_HANDLED }

and ther ya go...
__________________
I can no longer help here......school has started... :/ goodbye everybody :'(
VanillA Ice is offline
Send a message via MSN to VanillA Ice Send a message via Yahoo to VanillA Ice
Velocity36
Senior Member
Join Date: Jul 2005
Old 08-16-2005 , 20:20  
Reply With Quote #10

I think it has to be

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {      register_clcmd("cl_forwardspeed", "block_command")      register_clcmd("cl_sidespeed", "block_command")      register_clcmd("cl_backspeed", "block_command") } public block_command(id) {                   client_print(id, print_chat, "[SH] You are not allowed to use that command due to abuse protection!")                   client_print(id, print_console,"[SH] You are not allowed to use that command due to abuse protection!")                   return PLUGIN_HANDLED }
__________________
[img]http://img81.**************/img81/593/velocityferrari7mx.jpg[/img]
Velocity36 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 22:20.


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