AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help (https://forums.alliedmods.net/showthread.php?t=226696)

@.SizNeR 09-21-2013 18:38

Help
 
Code:
enum _:g_iMain {     m_TerroristShop,     m_CounterTerroristShop }; new const g_szShopsData[ g_iMain ][][ 2 ] = {     {         { "Health Menu", "CmdHealthMenu_Handler" }, // Line 41         { "Weapons Menu", "CmdWeaponsMenu_Handler" }     },         {         { "Health Menu", "CmdHealthMenu_Handler" }, // Line 46         { "Weapons Menu", "CmdWeaponsMenu_Handler" },         { "Armor Menu", "CmdArmorMenu_Handler" },         { "Revive \r| \w80 Points", "CmdReviveShop" }     } };

Error:
Code:

Error: Initialization data exceeds declared size on line 41
Error: Initialization data exceeds declared size on line 46


hornet 09-21-2013 20:15

Re: Help
 
Firstly use a descriptive thread title.
Your issue is because you've declared your 3rd array dimension with a maximum of 2 cells / characters.

@.SizNeR 09-21-2013 20:33

Re: Help
 
Quote:

Originally Posted by hornet (Post 2038783)
Firstly use a descriptive thread title.
Your issue is because you've declared your 3rd array dimension with a maximum of 2 cells / characters.

So can you try fix it to me please?

I changed it to:

Code:
new const g_szShopsData[ g_iMain ][][] = {     {         { "Health Menu", "CmdHealthMenu_Handler" },         { "Weapons Menu", "CmdWeaponsMenu_Handler" }     },         {         { "Health Menu", "CmdHealthMenu_Handler" },         { "Weapons Menu", "CmdWeaponsMenu_Handler" },         { "Armor Menu", "CmdArmorMenu_Handler" },         { "Revive \r| \w80 Points", "CmdReviveShop" }     } };

And now the amxxpc.exe is crushing...

Thanks for help. :)

Black Rose 09-21-2013 21:55

Re: Help
 
I think you're exceeding the maximum ammount of array dimensions (3).
Just make 2 arrays, one for CT and one for T.
Or combine the array and add a third option that defines which team it is for.

hornet 09-22-2013 04:29

Re: Help
 
Black Rose is right. Didn't pick up on that.


All times are GMT -4. The time now is 18:57.

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