AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Two diminsion array boolean tag mismatch (https://forums.alliedmods.net/showthread.php?t=189444)

pokemonmaster 07-07-2012 09:48

Two diminsion array boolean tag mismatch
 
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...

ConnorMcLeod 07-07-2012 09:56

Re: Two diminsion array boolean tag mismatch
 
Bool -> bool

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

Seems that you are completely confused.

pokemonmaster 07-07-2012 11:26

Re: Two diminsion array boolean tag mismatch
 
Do you suggest any other way of doing this?

fysiks 07-07-2012 11:28

Re: Two diminsion array boolean tag mismatch
 
Quote:

Originally Posted by pokemonmaster (Post 1745379)
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.

ConnorMcLeod 07-07-2012 11:53

Re: Two diminsion array boolean tag mismatch
 
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])



Bugsy 07-07-2012 12:09

Re: Two diminsion array boolean tag mismatch
 
Are you allowing players to vote more than once? Is it only one weapon per round?

pokemonmaster 07-07-2012 12:47

Re: Two diminsion array boolean tag mismatch
 
Quote:

Originally Posted by ConnorMcLeod (Post 1745396)
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?

Bugsy 07-07-2012 12:50

Re: Two diminsion array boolean tag mismatch
 
Quote:

Originally Posted by pokemonmaster (Post 1745444)
Just a question, why did you put the enum if you won't use it?

To be used in your switch().

ConnorMcLeod 07-07-2012 15:05

Re: Two diminsion array boolean tag mismatch
 
I haven't checked your whole code, if you don't use it, just remove it.


All times are GMT -4. The time now is 15:05.

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