AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   cl_cmdrate manager help (https://forums.alliedmods.net/showthread.php?t=8961)

danny 01-01-2005 10:49

cl_cmdrate manager help
 
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") }


XxAvalanchexX 01-02-2005 14:04

I'm assuming that get_user_info can't get cl_cmdrate. What does the console_print message look like?

danny 01-28-2005 12:33

I didn't see a console_print, it looked like nothing happened at all

Damocles 01-28-2005 13:19

get_user_info can only retrieve 'rate' and 'cl_updaterate', neither 'cl_rate', nor 'cl_cmdrate' can be fetched..trust me ive tried it :)

Revelation 01-29-2005 05:58

Code:
public client_disconnect(id) {     client_cmd(id,"cl_cmdrate %d",oldrate[id]) }
does that actually work on clients, or not?

XxAvalanchexX 01-29-2005 12:17

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 :)


Revelation 01-30-2005 05:46

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 ?

Damocles 01-30-2005 06:41

you can alter rate and updaterate because i do it. You just cant fetch or alter the cl_rate or cl_cmdrate values.

XxAvalanchexX 01-30-2005 15:31

client_disconnect is called right before they actually leave... I think?

2inspyr 11-30-2005 03:56

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


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

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