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

plugin doesnt work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
jookerx0
New Member
Join Date: Jan 2020
Old 01-15-2020 , 11:06   plugin doesnt work
Reply With Quote #1

hello im new here
i have problem with using plugin which after compile . in game will not work and giving me this error:


L 01/15/2020 - 19:19:56: Client CVAR querying is not enabled - check MM version!
L 01/15/2020 - 19:19:56: [AMXX] Run time error 10 (plugin "my.amxx") (native "query_client_cvar") - debug not enable

then after i turn on debug it will show this error:


L 01/15/2020 - 19:24:11: Client CVAR querying is not enabled - check MM version!
L 01/15/2020 - 19:24:11: [AMXX] Displaying debug trace (plugin "my.amxx")
L 01/15/2020 - 19:24:11: [AMXX] Run time error 10: native error (native "query_client_cvar")
L 01/15/2020 - 19:24:11: [AMXX] [0] my.sma::fps_check (line 29)


i want to block clients about using developer 1 (only developer 0 allowed)
and if they used "developer 1" then kick/ban them from server

im using this source code:

HTML Code:
#include <amxmodx>

#define MAXPLAYERS	32

new max_reset
new count[MAXPLAYERS+1]

public plugin_init() {
	register_plugin("Developer 0", "1.0", "connor")
	max_reset = register_cvar("max_bad_value", "5")
}

public plugin_cfg() {
	set_task(5.0, "fps_check", _, _, _, "b")
}

public client_connect(id) {
	count[id] = 0
}

public client_disconnect(id) {
	count[id] = 0
}

public fps_check() {
	new players[MAXPLAYERS], inum
	get_players(players, inum, "ch") //don't collect BOTs & HLTVs
	for(new i; i<inum; ++i)
		query_client_cvar(players[i] , "developer" , "cvar_result")
}

public cvar_result(id, const cvar[], const value[])
{
	if(equal(value, "Bad CVAR request"))
	{
		server_cmd("kick #%d Please remove the alias that blocks fps_max or developer cvar", get_user_userid(id))
	}

	new iValue = str_to_num(value)

	if(!iValue)
		return

	client_cmd(id, "developer 0")
	client_print(id, print_chat, "Your ^"developer^" cvar has been set to 0, don't touch it")
	count[id]++
	
	if(count[id] >= get_pcvar_num(max_reset))
		server_cmd("kick #%d You have bad cvar values to play on this server", get_user_userid(id))
}
thanks.
jookerx0 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 23:37.


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