Methodmaps on global variables
I'm probably missing something pretty simple. I'm getting used to the new syntax and have been running into an issue with global variables, specifically with datapacks. I'm getting some errors.
PHP Code:
|
Re: Methodmaps on global variables
Have a look at this....
https://forums.alliedmods.net/showthread.php?t=270519 It doesn't really relate to your question |
Re: Methodmaps on global variables
This
Code:
if(g_hMenuDataPack[iClient] != null) |
Re: Methodmaps on global variables
You need to use ResetPack(g_hMenuDataPack[iClient]) instead of .Reset()
|
Re: Methodmaps on global variables
Code:
g_hMenuDataPack[iClient].Reset(false); // or true to clear data Quote:
|
Re: Methodmaps on global variables
Looks like a compiler bug to me.
g_hMenuDataPack[iClient].Reset() should return "error 092: number of arguments does not match definition", or .Reset() should have "false" as default argument. |
Re: Methodmaps on global variables
Quote:
|
Re: Methodmaps on global variables
Judging from the error you're seeing, g_hMenuDataPack[iClient] is null when you're trying to call Reset on it. Which would happen if you called func2 for a client before calling func1 for a client.
Quote:
|
Re: Methodmaps on global variables
Quote:
But that error still appear even in same callback, when global variable is array. *Reset works when give parameter true or false PHP Code:
PHP Code:
*edit maybe it not get default bool value from ResetPack function from methodmap or something |
All times are GMT -4. The time now is 06:47. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.