Raised This Month: $ Target: $400
 0% 

[SOLVED] Multi dimensional array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 08-13-2012 , 12:12   [SOLVED] Multi dimensional array
Reply With Quote #1

I don't know what i'm doing :s
Code:
#include < amxmodx > public plugin_init( ) {     new const g_szCommands[ ][ ] =     {         { "war3menu",               "show_wc3Menu" },         { "say /war3Menu",          "show_wc3Menu" },         { "say_team /war3Menu",     "show_wc3Menu" },         { "changerace",             "command_ChangeRace" },         { "say /changerace",        "command_ChangeRace" },         { "say_team /changerace",   "command_ChangeRace" },         { "selectskill",            "command_SelectSkill" },         { "say /selectskill",       "command_SelectSkill" },         { "say_team /selectskill""command_SelectSkill" },         { "playerskills",           "command_PlayerSkills" },         { "say /playerskills",      "command_PlayerSkills" },         { "say_team /playerskills", "command_PlayerSkills" },         { "skillsinfo",             "command_SkillsInfo" },         { "say /skillsinfo",        "command_SkillsInfo" },         { "say_team /skillsinfo",   "command_SkillsInfo" },         { "itemsinfo",              "command_ItemInfo" },         { "say /itemsinfo",         "command_ItemInfo" },         { "say /itemsinfo",         "command_ItemInfo" },         { "war3help",               "command_wc3Help" },         { "say /war3help",          "command_wc3Help" },         { "say_team /war3help",     "command_wc3Help" },         { "ultimate",               "command_Ultimate" },         { "icons",                  "command_Icons" },         { "say /icons",             "command_Icons" },         { "say_team /icons",        "command_Icons" },         { "shopmenu",               "command_ShopMenu" },         { "say /shopmenu",          "command_ShopMenu" },         { "say_team /shopmenu",     "command_ShopMenu" },         { "level",                  "command_Level" },         { "say /level",             "command_Level" },         { "say_team /level",        "command_Level" }     }     //for( new i = 0; i < sizeof g_szCommands; i++ )         //register_clcmd( g_szCommands[ i ], g_szCommands[ i ][ ] ) }
How can i use multi-dimensional array to register commands ?
I don't want to use 2 arrays, one for command, one for handle.

Last edited by OvidiuS; 08-13-2012 at 12:19.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Merciless
BANNED
Join Date: Aug 2009
Location: Belgium
Old 08-13-2012 , 12:15   Re: Multi dimensional array
Reply With Quote #2

PHP Code:
register_clcmdg_szCommands][0], g_szCommands][1] ) 
Merciless is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 08-13-2012 , 12:19   Re: Multi dimensional array
Reply With Quote #3

Simple as that.

Thank you.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-13-2012 , 18:56   Re: [SOLVED] Multi dimensional array
Reply With Quote #4

Your array is declared wrong. It should have 3 dimensions, not just two. Hopefully you figured this out on your own already. Either way, it should be stated here.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 05:53.


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