SA-MP Forums Archive
error 018: initialization data exceeds declared size - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 018: initialization data exceeds declared size (/showthread.php?tid=364172)



error 018: initialization data exceeds declared size - CoaPsyFactor - 29.07.2012

Hello there,

So I have this little problem:

Код:
D:\samp\gamemodes\gm.pwn(158) : warning 228: length of initialler exceeds size of the enum field
D:\samp\gamemodes\gm.pwn(158) : error 018: initialization data exceeds declared size
pawn Код:
enum _factionInfos{
    fName[24],
    fColor[6],
    Float:fHQX,
    Float:fHQY,
    Float:fHQZ,
    Float:fiHQX,
    Float:fiHQY,
    Float:fiHQZ,
    fiHQ,
    Float:fDutyX,
    Float:fDutyY,
    Float:fDutyZ
}

new FactionInfos[MAX_FACTIONS][_factionInfos] = {
    {"Mayor", "D1A700", 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, 9999.99, 9999.99, 9999.99}, //This is line 158
    {"Sheriff Departmen", "009900", 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, 0.0, 0.0, 0.0},
    {"Medic Center", "8C1717", 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, 0.0, 0.0, 0.0},
    {"Fort Carson News", "97694F", 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, 9999.99, 9999.99, 9999.99},
    {"Tagliano", "000000", 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, 9999.99, 9999.99, 9999.99}
};



Re: error 018: initialization data exceeds declared size - [KHK]Khalid - 29.07.2012

what is the defination of MAX_FACTIONS?


Re: error 018: initialization data exceeds declared size - CoaPsyFactor - 29.07.2012

it is 5


Re: error 018: initialization data exceeds declared size - Vince - 29.07.2012

fColor needs to be 7 cells long as it also has to hold a NULL character. I assume you're going to use these colors embedded, otherwise you should just input them as integers.


Re: error 018: initialization data exceeds declared size - CoaPsyFactor - 29.07.2012

Thanks, that helped, working now It must be string, cus system is working with strings