enum crashes compiler
#1

Ok I have a snippet of code i've used in 4 of my scripts/servers that checks for hacks.

It compiles fine in all of my scripts....except 1.

When it is like this:
pawn Код:
enum hkinfo
{
        firstspawn,
        ppname[MAX_PLAYER_NAME],
        hacker
};
new gpInfo[MAX_PLAYERS][hkinfo];
it crashes the compiler.


HOWEVER when it is like this:
pawn Код:
enum hkinfo
{
        //firstspawn,
        ppname[MAX_PLAYER_NAME],
        hacker
};
new gpInfo[MAX_PLAYERS][hkinfo];
...or if i comment out one of the others, it compiles (with errors of course but yeah)

I've never encountered this and am confused. I've placed it in some of my scripts before with no issues. I'm so confused.
Reply
#2

Do you use any of those functions? If so, please paste them. I just tried this and it compiled just fine:

pawn Код:
#include <a_samp>

enum hkinfo
{
    firstspawn,
    ppname[MAX_PLAYER_NAME],
    hacker
};

new gpInfo[MAX_PLAYERS][hkinfo];

public OnPlayerSpawn(playerid)
{
    if(gpInfo[playerid][hacker] == 1) return false;

    return true;
}
Reply
#3

Quote:
Originally Posted by Mionee
Посмотреть сообщение
Do you use any of those functions? If so, please paste them. I just tried this and it compiled just fine:

pawn Код:
#include <a_samp>

enum hkinfo
{
    firstspawn,
    ppname[MAX_PLAYER_NAME],
    hacker
};

new gpInfo[MAX_PLAYERS][hkinfo];

public OnPlayerSpawn(playerid)
{
    if(gpInfo[playerid][hacker] == 1) return false;

    return true;
}
I figued out what i did wrong.
I moved the enum near the top of the script and it compiled perfectly, i can't believe i didn't think of that.
Thanks to Skyrise lol

Thanks for the reply Mionee +Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)