Thread: [Solved] [Maps ] Spawn Bosses
View Single Post
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-21-2020 , 12:53   Re: [Maps ] Spawn Bosses
Reply With Quote #16

Quote:
Originally Posted by HamletEagle View Post
You didn't, as your code does not even compile.

if(g_mapname) is wrong because g_mapname is an array, you probably meant g_mapname[0](to check if the string is not empty).
switch(g_mapname) switch cannot be used on strings.
case Alien: Alien is not a string, "Alien" is(unless you defined somewhere new Allien[] = "Alien", which you probably did not, and if you did you should have posted this in your answer). Alien, as you used it in your code, is an unknown symbol and will produce a compilation error.
Regardless, the code you posted will not compile because of issues 1 and 2 anyway.

A simple test plugin:
PHP Code:
#include <amxmodx>

public plugin_init()
{
    new array[
32]
    if(array)
    {
        switch(array)
        {
            case 
"aaa"
            {
            }
            case 
"bbb":
            {
            }
        }
    }

Can you compile it? You can't because it is not valid.

Please test your code before posting and trying to help others so you don't end up confusing them instead.
Sorry for letting you down, I compiled the wrong plugin. I was sure that it should work .
__________________
Contact! || Discord:
Mr_Boopsy_#2066
supertrio17 is offline