View Single Post
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 05-05-2012 , 19:29   Re: [SNIPPET] How to block the change notification of cvars with NOTIFY flag
Reply With Quote #14

Does anyone got it to work recently ?

Code:
public OnPluginStart()
{
	CreateConVar( "testcvar", "1", "Team Scramble version", FCVAR_PLUGIN );
	HookEvent("server_cvar", Event_ServerCvar, EventHookMode_Pre);
}
public Action:Event_ServerCvar(Handle:event, const String:name[], bool:dontBroadcast)
{
	decl String:cvarName[64];
	GetEventString(event, "cvarname", cvarName, sizeof(cvarName));
	PrintToChatAll(cvarName);

	if (StrEqual(cvarName, "testcvar")) {
		PrintToChatAll("string matched and handled");
		return Plugin_Handled;
	}
	
	return Plugin_Continue;
}
Doesn't work. Also it seems that the whole event isn't even triggered.

Is there another way ?
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work
RedSword is offline