Raised This Month: $ Target: $400
 0% 

Solved [Maps ] Spawn Bosses


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-21-2020 , 07:20   Re: [Maps ] Spawn Bosses
Reply With Quote #6

Quote:
Originally Posted by supertrio17 View Post
I tried it with a mapname and it did work.
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.
__________________

Last edited by HamletEagle; 06-21-2020 at 07:21.
HamletEagle is offline
 



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 16:58.


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