Raised This Month: $ Target: $400
 0% 

Stack error with hook_cvar_change


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
luxor
Member
Join Date: Jan 2014
Old 12-26-2015 , 18:15   Stack error with hook_cvar_change
Reply With Quote #1

hello, i receive stack error when i'm trying to set any value for rcon_password.
what i was doing wrong ?

Code:
#include <amxmisc>

#if AMXX_VERSION_NUM < 183 
    #assert AMX Mod X v1.8.3 or later library required!
#endif 

public plugin_init()
{
	register_plugin
	(
		.plugin_name = "Block changing rcon_password",
		.version     = "1.0",
		.author      = "lüxor"
	);
	
	hook_cvar_change(get_cvar_pointer("rcon_password"), "setDefaultValue");
}

public setDefaultValue(PointerCvar, const OldValue[], const NewValue[])
{
	set_pcvar_string(PointerCvar, OldValue);
}

Console :
Code:
] restart
Server logging data to file logs\L1227013.log
L 12/27/2015 - 01:11:05: -------- Mapchange to de_dust2 --------
[AMXX] Loaded 1 admin from file
Executing AMX Mod X Configuration File 
Scrolling message displaying frequency: 10:00 minutes
] rcon_password
"rcon_password" is "123"
] rcon_password meow
L 12/27/2015 - 01:12:02: [AMXX] Displaying debug trace (plugin "block_changing_rcon_pass.amxx", version "1.0")
L 12/27/2015 - 01:12:02: [AMXX] Run time error 3: stack error
luxor 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 17:52.


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