Raised This Month: $ Target: $400
 0% 

cl_cmdrate manager help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
danny
Junior Member
Join Date: Apr 2004
Old 01-01-2005 , 10:49   cl_cmdrate manager help
Reply With Quote #1

Posted my problem in a reply to another thread.
Maybe it would be more appropriate here.
Original post: http://forums.alliedmods.net/showthr...?p=77959#81324

Quote:
Originally Posted by danny
Right I just tried that avalanche. Using amxmodx 1.0.
I have core and cstrike module. amx_plugincfgmenu showed it was running.
As this only sends a message the the player with a low rate I added a few lines which would message everyone (I think, I've never scripted before).

So with your version, and my slightly modified version it didn't work. People could join with lower than 50 cl_cmdrate and it would stay less than 50. I also put sv_mincmdrate 50 in server.cfg.

Code:
#include <amxmodx> new oldrate[33]; new name[33]; public client_putinserver(id) {     get_user_name(id,name[id],33)     new rate[5]     get_user_info(id,"cl_cmdrate",rate,4)     oldrate[id] = str_to_num(rate)     console_print(0,"%s joined the server with cl_cmdrate %d",name[id],oldrate[id])     if(oldrate[id] < get_cvar_num("sv_mincmdrate")) {         console_print(id,"%s using invalid rate of %d, increasing to %d",name[id],oldrate[id],get_cvar_num("sv_mincmdrate"))         client_cmd(id,"cl_cmdrate %d",get_cvar_num("sv_mincmdrate"))     } } public client_disconnect(id) {     client_cmd(id,"cl_cmdrate %d",oldrate[id]) } public plugin_init() {     register_plugin("RestrictRate","0.1","Avalanche")     register_cvar("sv_mincmdrate","50")     register_clcmd("amx_test","checktest") }
danny is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-02-2005 , 14:04  
Reply With Quote #2

I'm assuming that get_user_info can't get cl_cmdrate. What does the console_print message look like?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
danny
Junior Member
Join Date: Apr 2004
Old 01-28-2005 , 12:33  
Reply With Quote #3

I didn't see a console_print, it looked like nothing happened at all
danny is offline
Damocles
Member
Join Date: Jan 2005
Old 01-28-2005 , 13:19  
Reply With Quote #4

get_user_info can only retrieve 'rate' and 'cl_updaterate', neither 'cl_rate', nor 'cl_cmdrate' can be fetched..trust me ive tried it
Damocles is offline
Revelation
Junior Member
Join Date: Jan 2005
Old 01-29-2005 , 05:58  
Reply With Quote #5

Code:
public client_disconnect(id) {     client_cmd(id,"cl_cmdrate %d",oldrate[id]) }
does that actually work on clients, or not?
Revelation is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-29-2005 , 12:17  
Reply With Quote #6

Quote:
Originally Posted by Revelation
Code:
public client_disconnect(id) {     client_cmd(id,"cl_cmdrate %d",oldrate[id]) }
does that actually work on clients, or not?
If you had the ability to see you would've noticed Damocles' post:

Quote:
Originally Posted by Damocles
get_user_info can only retrieve 'rate' and 'cl_updaterate', neither 'cl_rate', nor 'cl_cmdrate' can be fetched..trust me ive tried it
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Revelation
Junior Member
Join Date: Jan 2005
Old 01-30-2005 , 05:46  
Reply With Quote #7

Quote:
Originally Posted by XxAvalanchexX
Quote:
Originally Posted by Revelation
Code:
public client_disconnect(id) {     client_cmd(id,"cl_cmdrate %d",oldrate[id]) }
does that actually work on clients, or not?
If you had the ability to see you would've noticed Damocles' post:

Quote:
Originally Posted by Damocles
get_user_info can only retrieve 'rate' and 'cl_updaterate', neither 'cl_rate', nor 'cl_cmdrate' can be fetched..trust me ive tried it
oops I meant running a command after the client has disconnected. Can you still change their rate/updaterate in the function client_disconnect ?
Revelation is offline
Damocles
Member
Join Date: Jan 2005
Old 01-30-2005 , 06:41  
Reply With Quote #8

you can alter rate and updaterate because i do it. You just cant fetch or alter the cl_rate or cl_cmdrate values.
Damocles is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-30-2005 , 15:31  
Reply With Quote #9

client_disconnect is called right before they actually leave... I think?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
2inspyr
SourceMod Donor
Join Date: Dec 2004
Old 11-30-2005 , 03:56  
Reply With Quote #10

to get those values you need to use "query_user_cvar" like i have had to, to get the values of cl_forwardspeed, and others.. the only problem im having is making client_cmd work :S
__________________
hmmms........
2inspyr 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:15.


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