Raised This Month: $ Target: $400
 0% 

Error in AMX MOD X: Static variable is not a static!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
karaulov
Senior Member
Join Date: Jul 2018
Old 10-14-2021 , 23:46   Error in AMX MOD X: Static variable is not a static!
Reply With Quote #1

Code inside .inc

Code:
stock rm_base_plugin_id()
{
	static pluginid = -1;

	if (pluginid != -1)
	{	
		log_amx("USE STATIC! %d", pluginid);
		return pluginid;
	}
	
	new num_of_plugins = get_pluginsnum()
	for (new i = 0; i < num_of_plugins; ++i)
	{
		if (get_func_id("RM_RegisterPlugin",i) >= 0)
		{
			pluginid = i;
			break;
		}
	}
	
 	return pluginid;
}
I need cache pluginid value for speedup. But I can't see 'USE STATIC! ' message in console.

Why static not works as I need (like in c/c++ language)
karaulov 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 11:31.


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