Raised This Month: $ Target: $400
 0% 

Two diminsion array boolean tag mismatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 07-07-2012 , 09:48   Two diminsion array boolean tag mismatch
Reply With Quote #1

I'm trying to make an round menu plugin, but I have a problem with the two diminsion arrays when compiling it gives a tag mismatch error, everything is explained in the code:
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Rounds Menu" #define VERSION "1.0" #define AUTHOR "Khalid" #define FLAG ADMIN_MAP new bool:bNextRound = false //new bool:knife, bool:usp, bool:deagle, bool:m4a1, bool:ak, bool:awp new Bool:Round_forwards[][] = {     //This was made as a boolean to check which round type is used     "fw_Knife",     // 0     "fw_USP",       // 1     "fw_Deagle",        // 2     "fw_M4A1",      // 3     "fw_AK-47",     // 4     "fw_AWP"        // 5 } new gKeys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5 public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("say /rounds", "rounds_menu", FLAG)     register_menucmd(register_menuid("Choose next round type"), gKeys, "menu_handler")     register_event("HLTV", "eNewRound", "a", "1=0", "2=0") } public rounds_menu(id, level, cid) {     if(!cmd_access(id, level, cid, 2))         return PLUGIN_HANDLED     static menu[128]     format(menu, 127, "Choose the next round:^n1. Knife round^2. USP round^n3. Deagle round^n4. M4A1 round^n5. AK-47 round^n.6. AWP round")     show_menu(id, gKeys, menu) } public menu_handler(id, key) {     switch(key)     {         case 0:             Round_forwards[0] = true                     case 1:             Round_forwards[1] = true                 case 2:             Round_forwards[2] = true                 case 3:             Round_forwards[3] = true                 case 4:             Round_forwards[4] = true                 case 5:             Round_forwards[5] = true     } } public eNewRound() {     static round_name[50]     for(new i; i < 6; i++)      // from 0 Until 5     {         if(Round_forwards[i] == true)         {             set_task(0.2, Round_forwards[i], 0) // This was supposed to replace the Round_forwards with                             // the correct forward to start the round         }                 else return PLUGIN_HANDLED     }     return PLUGIN_HANDLED } // Finally set_task forwards public fw_knife() {     // round handler } public fw_m4a1() {     // Round handler } public fw_usp() {     // Round handler } // etc...
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2012 , 09:56   Re: Two diminsion array boolean tag mismatch
Reply With Quote #2

Bool -> bool

But, you can't tag a string array as bolean...

Seems that you are completely confused.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-07-2012 at 09:57.
ConnorMcLeod is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 07-07-2012 , 11:26   Re: Two diminsion array boolean tag mismatch
Reply With Quote #3

Do you suggest any other way of doing this?
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-07-2012 , 11:28   Re: Two diminsion array boolean tag mismatch
Reply With Quote #4

Quote:
Originally Posted by pokemonmaster View Post
Do you suggest any other way of doing this?
Yeah, make your boolean array a boolean array instead of an array of strings.

Then you have to make an array of strings to use in the set_task() function.
__________________

Last edited by fysiks; 07-07-2012 at 11:29.
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2012 , 11:53   Re: Two diminsion array boolean tag mismatch
Reply With Quote #5

On single variable that is holding the round type :

PHP Code:
enum
{
    
Round_Knife,  // 0
    
Round_USP,      // 1
    
Round_Deagle,        // 2
    
Round_M4A,    // 3
    
Round_AK47,  // 4
    
Round_AWP // 5
}

new 
Round_forwards[][] = {
    
"fw_Knife",  // 0
    
"fw_USP",      // 1
    
"fw_Deagle",        // 2
    
"fw_M4A1",    // 3
    
"fw_AK-47",  // 4
    
"fw_AWP"        // 5
}

new 
g_iRoundType

public menu_handler(idkey)
{
    
g_iRoundType key
}

public 
eNewRound()
{
    
set_task(0.2Round_forwards[g_iRoundType])

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-07-2012 at 11:53.
ConnorMcLeod is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-07-2012 , 12:09   Re: Two diminsion array boolean tag mismatch
Reply With Quote #6

Are you allowing players to vote more than once? Is it only one weapon per round?
__________________
Bugsy is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 07-07-2012 , 12:47   Re: Two diminsion array boolean tag mismatch
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
On single variable that is holding the round type :

PHP Code:
enum
{
    
Round_Knife,  // 0
    
Round_USP,      // 1
    
Round_Deagle,        // 2
    
Round_M4A,    // 3
    
Round_AK47,  // 4
    
Round_AWP // 5
}

new 
Round_forwards[][] = {
    
"fw_Knife",  // 0
    
"fw_USP",      // 1
    
"fw_Deagle",        // 2
    
"fw_M4A1",    // 3
    
"fw_AK-47",  // 4
    
"fw_AWP"        // 5
}

new 
g_iRoundType

public menu_handler(idkey)
{
    
g_iRoundType key
}

public 
eNewRound()
{
    
set_task(0.2Round_forwards[g_iRoundType])

Just a question, why did you put the enum if you won't use it?
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-07-2012 , 12:50   Re: Two diminsion array boolean tag mismatch
Reply With Quote #8

Quote:
Originally Posted by pokemonmaster View Post
Just a question, why did you put the enum if you won't use it?
To be used in your switch().
__________________
Bugsy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2012 , 15:05   Re: Two diminsion array boolean tag mismatch
Reply With Quote #9

I haven't checked your whole code, if you don't use it, just remove it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



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


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