SA-MP Forums Archive
error 052: multi-dimensional arrays must be fully initialized - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error 052: multi-dimensional arrays must be fully initialized (/showthread.php?tid=273639)



error 052: multi-dimensional arrays must be fully initialized - deqn_0000 - 02.08.2011

pawn Code:
new TeamInfo[MAX_TEAMS][gInfo]= {
{"Civilian", CIVILIAN_COLOR, 0, 0, 0, 0, 0, "None","None","None","None","City Manager","Mayor",},
{"Grove Street Families", GROVE_COLOR, 0, 0, 0, 0, 0, "Gangsta","Original Gangster","Double OG","Left Hand","Right Hand","Boss"},
{"Rolling Height Ballas", BALLA_COLOR, 0, 0, 0, 0, 0, "Trainee G","Original G","Gangsta","Left Hand","Right Hand","Boss"},
{"Los Santos Vagos", VAGOS_COLOR, 0, 0, 0, 0, 0, "Rank1","Rank2","Rank3","Rank4","Rank5","Leader"},
{"Varrio Los Aztecas", AZTECA_COLOR, 0, 0, 0, 0, 0, "Rank1","Rank2","Rank3","Rank4","Rank5","Leader"},
{"Italian Mafia", TRIAD_COLOR, 0, 0, 0, 0, 0, "Driver","Guard","Killer","Manager","Right Hand","Godfather"},
{"Japanese Yakuza", YAKUZA_COLOR, 0, 0, 0, 0, 0, "Rank1","Rank2","Rank3","Rank4","Rank5","Leader"},
{"Vinewood Cripz", CRIPZ_COLOR, 0, 0, 0, 0, 0, "Gangster","Professional Gangsta","Double OG","Triple OG","Co-Boss","Boss"},
{"Los Santos Police", POLICE_COLOR, 0, 0, 0, 0, 0, "Cadet","Officer","Sergeant","Inspector","Assistant Chief","Chief"},
{"Bad Boys", BADBOYS_COLOR, 0, 0, 0, 0, 0, "Gangster","Drug Dealer","Driver","Left Hand","Right Hand","Boss"},
{"Los Santos Army", COLOR_DARKGREEN, 0, 0, 0, 0, 0, "Private","Lieutenant","Captain","Major","Colonel","General"},
{"San Andreas Army Aviation", 0x62620040, 0, 0, 0, 0, 0, "Recruit","Soldier","Major","Captain","Commander","General"},
{"Biker Boys", COLOR_RED, 0, 0, 0, 0, 0, "Trainee biker","Rider","Biker","Left Hand","Right Hand","Boss"},
{"Jizzy's Club", COLOR_PINK, 0, 0, 0, 0, 0, "Messenger","Soldier","Manager","Left Hand","Right Hand","Jizzy"},
{"Las Venturas Bloods", 0xADAD303A, 0, 0, 0, 0, 0, "Gangsta","OG","Double OG","Left Hand","Right Hand","Boss"},
{"Asian Triads", 0xFF80003E, 0, 0, 0, 0, 0, "Dealer","Gangsta","OGangsta","Left Hand","Right Hand","Da Boss"},
{"Los Santos MIB Agents", 0x3AD18D76, 0, 0, 0, 0, 0, "New Agent","Agent","Special Agent","Secret Agent","MIB Agent","Professional Agent"},
{"Russian Mafia", 0x8000FF72, 0, 0, 0, 0, 0, "Driver","Gangster","Original Gangster","Left Hand","Co-Boss","BOSS"},
{"C.I.A", 0x4E00008B, 0, 0, 0, 0, 0, "Agent","Special Agent","Secret Agent","CIA Agent","Professional Agent","BOSS"},
{"FBI", 0x808080FF, 0, 0, 0, 0, 0, "Agent","Agent","Agent","Agent","Agent","Agent"}

}; //Line 303
error log :
pawn Code:
C:\Documents and Settings\R3dZerg\Desktop\gangwars4.pwn(303) : error 052: multi-dimensional arrays must be fully initialized



Re: error 052: multi-dimensional arrays must be fully initialized - Calgon - 02.08.2011

Try reading a little bit of the Pawn Language Guide, (specifically page 62 onwards) this isn't how you declare arrays with multiple types of data.


AW: error 052: multi-dimensional arrays must be fully initialized - samtey - 02.08.2011

Well, there I have to give u right!

@deqn

WTF is ; after ur last barrel?

pawn Code:
new TeamInfo[MAX_TEAMS][gInfo]= {
{"Civilian", CIVILIAN_COLOR, 0, 0, 0, 0, 0, "None","None","None","None","City Manager","Mayor",},
{"Grove Street Families", GROVE_COLOR, 0, 0, 0, 0, 0, "Gangsta","Original Gangster","Double OG","Left Hand","Right Hand","Boss"},
{"Rolling Height Ballas", BALLA_COLOR, 0, 0, 0, 0, 0, "Trainee G","Original G","Gangsta","Left Hand","Right Hand","Boss"},
{"Los Santos Vagos", VAGOS_COLOR, 0, 0, 0, 0, 0, "Rank1","Rank2","Rank3","Rank4","Rank5","Leader"},
{"Varrio Los Aztecas", AZTECA_COLOR, 0, 0, 0, 0, 0, "Rank1","Rank2","Rank3","Rank4","Rank5","Leader"},
{"Italian Mafia", TRIAD_COLOR, 0, 0, 0, 0, 0, "Driver","Guard","Killer","Manager","Right Hand","Godfather"},
{"Japanese Yakuza", YAKUZA_COLOR, 0, 0, 0, 0, 0, "Rank1","Rank2","Rank3","Rank4","Rank5","Leader"},
{"Vinewood Cripz", CRIPZ_COLOR, 0, 0, 0, 0, 0, "Gangster","Professional Gangsta","Double OG","Triple OG","Co-Boss","Boss"},
{"Los Santos Police", POLICE_COLOR, 0, 0, 0, 0, 0, "Cadet","Officer","Sergeant","Inspector","Assistant Chief","Chief"},
{"Bad Boys", BADBOYS_COLOR, 0, 0, 0, 0, 0, "Gangster","Drug Dealer","Driver","Left Hand","Right Hand","Boss"},
{"Los Santos Army", COLOR_DARKGREEN, 0, 0, 0, 0, 0, "Private","Lieutenant","Captain","Major","Colonel","General"},
{"San Andreas Army Aviation", 0x62620040, 0, 0, 0, 0, 0, "Recruit","Soldier","Major","Captain","Commander","General"},
{"Biker Boys", COLOR_RED, 0, 0, 0, 0, 0, "Trainee biker","Rider","Biker","Left Hand","Right Hand","Boss"},
{"Jizzy's Club", COLOR_PINK, 0, 0, 0, 0, 0, "Messenger","Soldier","Manager","Left Hand","Right Hand","Jizzy"},
{"Las Venturas Bloods", 0xADAD303A, 0, 0, 0, 0, 0, "Gangsta","OG","Double OG","Left Hand","Right Hand","Boss"},
{"Asian Triads", 0xFF80003E, 0, 0, 0, 0, 0, "Dealer","Gangsta","OGangsta","Left Hand","Right Hand","Da Boss"},
{"Los Santos MIB Agents", 0x3AD18D76, 0, 0, 0, 0, 0, "New Agent","Agent","Special Agent","Secret Agent","MIB Agent","Professional Agent"},
{"Russian Mafia", 0x8000FF72, 0, 0, 0, 0, 0, "Driver","Gangster","Original Gangster","Left Hand","Co-Boss","BOSS"},
{"C.I.A", 0x4E00008B, 0, 0, 0, 0, 0, "Agent","Special Agent","Secret Agent","CIA Agent","Professional Agent","BOSS"},
{"FBI", 0x808080FF, 0, 0, 0, 0, 0, "Agent","Agent","Agent","Agent","Agent","Agent"}

}; //Line 303



Re: error 052: multi-dimensional arrays must be fully initialized - deqn_0000 - 02.08.2011

@samtey after "};" i have:
pawn Code:
enum tinfo
{
     turfID,
     turfName[ 40 ],
     cityName[ 40 ],
     Float:zMinX,
     Float:zMinY,
     Float:zMaxX,
     Float:zMaxY,
     TurfColor,
     TurfOwner,
     TurfAttacker,
     TurfKills,
     TurfAttackKills,
     TurfWarStarted,
     MIT
}
@Calg00ne I don't think so if I read it that will help me..


AW: error 052: multi-dimensional arrays must be fully initialized - samtey - 02.08.2011

Did u took away the ; ?

pawn Code:
new TeamInfo[MAX_TEAMS][gInfo]= {
{"Civilian", CIVILIAN_COLOR, 0, 0, 0, 0, 0, "None","None","None","None","City Manager","Mayor",},
{"Grove Street Families", GROVE_COLOR, 0, 0, 0, 0, 0, "Gangsta","Original Gangster","Double OG","Left Hand","Right Hand","Boss"},
{"Rolling Height Ballas", BALLA_COLOR, 0, 0, 0, 0, 0, "Trainee G","Original G","Gangsta","Left Hand","Right Hand","Boss"},
{"Los Santos Vagos", VAGOS_COLOR, 0, 0, 0, 0, 0, "Rank1","Rank2","Rank3","Rank4","Rank5","Leader"},
{"Varrio Los Aztecas", AZTECA_COLOR, 0, 0, 0, 0, 0, "Rank1","Rank2","Rank3","Rank4","Rank5","Leader"},
{"Italian Mafia", TRIAD_COLOR, 0, 0, 0, 0, 0, "Driver","Guard","Killer","Manager","Right Hand","Godfather"},
{"Japanese Yakuza", YAKUZA_COLOR, 0, 0, 0, 0, 0, "Rank1","Rank2","Rank3","Rank4","Rank5","Leader"},
{"Vinewood Cripz", CRIPZ_COLOR, 0, 0, 0, 0, 0, "Gangster","Professional Gangsta","Double OG","Triple OG","Co-Boss","Boss"},
{"Los Santos Police", POLICE_COLOR, 0, 0, 0, 0, 0, "Cadet","Officer","Sergeant","Inspector","Assistant Chief","Chief"},
{"Bad Boys", BADBOYS_COLOR, 0, 0, 0, 0, 0, "Gangster","Drug Dealer","Driver","Left Hand","Right Hand","Boss"},
{"Los Santos Army", COLOR_DARKGREEN, 0, 0, 0, 0, 0, "Private","Lieutenant","Captain","Major","Colonel","General"},
{"San Andreas Army Aviation", 0x62620040, 0, 0, 0, 0, 0, "Recruit","Soldier","Major","Captain","Commander","General"},
{"Biker Boys", COLOR_RED, 0, 0, 0, 0, 0, "Trainee biker","Rider","Biker","Left Hand","Right Hand","Boss"},
{"Jizzy's Club", COLOR_PINK, 0, 0, 0, 0, 0, "Messenger","Soldier","Manager","Left Hand","Right Hand","Jizzy"},
{"Las Venturas Bloods", 0xADAD303A, 0, 0, 0, 0, 0, "Gangsta","OG","Double OG","Left Hand","Right Hand","Boss"},
{"Asian Triads", 0xFF80003E, 0, 0, 0, 0, 0, "Dealer","Gangsta","OGangsta","Left Hand","Right Hand","Da Boss"},
{"Los Santos MIB Agents", 0x3AD18D76, 0, 0, 0, 0, 0, "New Agent","Agent","Special Agent","Secret Agent","MIB Agent","Professional Agent"},
{"Russian Mafia", 0x8000FF72, 0, 0, 0, 0, 0, "Driver","Gangster","Original Gangster","Left Hand","Co-Boss","BOSS"},
{"C.I.A", 0x4E00008B, 0, 0, 0, 0, 0, "Agent","Special Agent","Secret Agent","CIA Agent","Professional Agent","BOSS"},
{"FBI", 0x808080FF, 0, 0, 0, 0, 0, "Agent","Agent","Agent","Agent","Agent","Agent"}

}
FIRST try this!


Re: error 052: multi-dimensional arrays must be fully initialized - deqn_0000 - 02.08.2011

I tried it give me more 1 error


AW: error 052: multi-dimensional arrays must be fully initialized - samtey - 02.08.2011

Show me the error and a part after and before ur script above, okay?


Re: error 052: multi-dimensional arrays must be fully initialized - deqn_0000 - 02.08.2011

with ";"
pawn Code:
C:\Documents and Settings\R3dZerg\Desktop\gangwars4.pwn(303) : error 052: multi-dimensional arrays must be fully initialized
without ";"
pawn Code:
C:\Documents and Settings\R3dZerg\Desktop\gangwars4.pwn(303) : error 052: multi-dimensional arrays must be fully initialized
C:\Documents and Settings\R3dZerg\Desktop\gangwars4.pwn(304) : error 001: expected token: ";", but found "enum"
pawn Code:
enum tinfo //Line 304
{
     turfID,
     turfName[ 40 ],
     cityName[ 40 ],
     Float:zMinX,
     Float:zMinY,
     Float:zMaxX,
     Float:zMaxY,
     TurfColor,
     TurfOwner,
     TurfAttacker,
     TurfKills,
     TurfAttackKills,
     TurfWarStarted,
     MIT
}



AW: error 052: multi-dimensional arrays must be fully initialized - samtey - 02.08.2011

Place your enum before of all defined variables! Or before the variables which u need for enum!


Re: error 052: multi-dimensional arrays must be fully initialized - deqn_0000 - 02.08.2011

before:
pawn Code:
enum gInfo
{
    TeamName[64],
    TeamColor,
    TurfWarsWon,
    TurfWarsLost,
    RivalsKilled,
    HomiesDied,
    TeamScore,
    fRank1[256],
    fRank2[256],
    fRank3[256],
    fRank4[256],
    fRank5[256],
    fRank6[256]
}
after:
pawn Code:
enum tinfo
{
     turfID,
     turfName[ 40 ],
     cityName[ 40 ],
     Float:zMinX,
     Float:zMinY,
     Float:zMaxX,
     Float:zMaxY,
     TurfColor,
     TurfOwner,
     TurfAttacker,
     TurfKills,
     TurfAttackKills,
     TurfWarStarted,
     MIT
}



AW: error 052: multi-dimensional arrays must be fully initialized - samtey - 02.08.2011

Lol, u didn't understand! I mean: Both ur enums: PLACE THEM BEFORE ALL DEFINED VARIABLES!!


Re: error 052: multi-dimensional arrays must be fully initialized - Stylock - 02.08.2011

Oh lord.. I believe 32 cells would be enough
Код:
fRank1[32],
fRank2[32],
fRank3[32],
fRank4[32],
fRank5[32],
fRank6[32]
And remove useless comma to fix the error
Код:
..."None","City Manager","Mayor",},



Re: error 052: multi-dimensional arrays must be fully initialized - deqn_0000 - 02.08.2011

YJIET I tried this but again
pawn Код:
C:\Documents and Settings\R3dZerg\Desktop\gangwars4.pwn(303) : error 052: multi-dimensional arrays must be fully initialized
ah @samtey i really don't understand I'm newbie if you wanna give me skype,msn or maybe email on private message I will send you the script to see


Re: error 052: multi-dimensional arrays must be fully initialized - wups - 02.08.2011

samtey, don't talk shit. That ';' is NEEDED there.
Read the manual, and you'll see where is your problem.
(MAX_TEAMS Should be set to 20).


Re: error 052: multi-dimensional arrays must be fully initialized - Stylock - 02.08.2011

set MAX_TEAMS to 20. If that won't help, then I'm useless.


Re: error 052: multi-dimensional arrays must be fully initialized - deqn_0000 - 02.08.2011

YJIET then how must looks the code?


Re: error 052: multi-dimensional arrays must be fully initialized - Stylock - 02.08.2011

Like this
pawn Код:
#define MAX_TEAMS 20



Re: error 052: multi-dimensional arrays must be fully initialized - deqn_0000 - 02.08.2011

yeah it works ! THANKS A LOT ! i give you rep !


Re: error 052: multi-dimensional arrays must be fully initialized - Stylock - 02.08.2011

I actually noticed that wups said it before me but no problem


Re: error 052: multi-dimensional arrays must be fully initialized - deqn_0000 - 02.08.2011

I gave him too rep