Raised This Month: $ Target: $400
 0% 

Must enums be "global"?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
PartialCloning
Senior Member
Join Date: Dec 2015
Old 07-22-2018 , 22:38   Must enums be "global"?
Reply With Quote #1

PHP Code:
#include <amxmodx>

new gTest;

public 
plugin_init()
{
    
MyFunction();
}

MyFunction()
{
    if(
gTest)
    {
        new 
Player 0;

        
enum TestEnum {iTestszTest[20]};
        new 
Buffer[TestEnum];
    }
    else
    {
        new 
Player 1;
    }

Error when compiling: "error 021: symbol already defined: "Player"".

When I remove the enum or make it global it compiles.
PartialCloning 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 12:38.


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