SA-MP Forums Archive
[Need Help] Error - 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: [Need Help] Error (/showthread.php?tid=130872)



[Need Help] Error - geerdinho8 - 28.02.2010

I have this error:

Код:
C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\LSTW2Uv1.pwn(98) : error 052: multi-dimensional arrays must be fully initialized
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
lines:

Код:
new TeamInfo[ MAX_TEAMS ][ teaminfo ]= {
{ "Varrio Los Aztecas", AZTECAS_COLOR, 0, 0, 0, 0, 0},
{ "Los Santos Vagos",  VAGOS_COLOR,  0, 0, 0, 0, 0},
{ "The Ballas Family",  BALLAS_COLOR,  0, 0, 0, 0, 0},
{ "Grove Street Familie",  GROVE_COLOR,  0, 0, 0, 0, 0},
{ "Los Santos Police Department",   COPS_COLOR,   0, 0, 0, 0, 0}
};code]



Re: [Need Help] Error - woot - 28.02.2010

Remove the comma from the last line in the array.

pawn Код:
new TeamInfo[ MAX_TEAMS ][ teaminfo ]= {
{ "Varrio Los Aztecas", AZTECAS_COLOR, 0, 0, 0, 0, 0},
{ "Los Santos Vagos",  VAGOS_COLOR,  0, 0, 0, 0, 0},
{ "The Ballas Family",  BALLAS_COLOR,  0, 0, 0, 0, 0},
{ "Grove Street Familie",  GROVE_COLOR,  0, 0, 0, 0, 0},
{ "Los Santos Police Department",   COPS_COLOR,   0, 0, 0, 0, 0}
};



Re: [Need Help] Error - geerdinho8 - 28.02.2010

Quote:
Originally Posted by //exora
Remove the comma from the last line in the array.

pawn Код:
new TeamInfo[ MAX_TEAMS ][ teaminfo ]= {
{ "Varrio Los Aztecas", AZTECAS_COLOR, 0, 0, 0, 0, 0},
{ "Los Santos Vagos",  VAGOS_COLOR,  0, 0, 0, 0, 0},
{ "The Ballas Family", BALLAS_COLOR, 0, 0, 0, 0, 0},
{ "Grove Street Familie", GROVE_COLOR,  0, 0, 0, 0, 0},
{ "Los Santos Police Department",  COPS_COLOR,  0, 0, 0, 0, 0}
};
I still got another error see first post


Re: [Need Help] Error - geerdinho8 - 28.02.2010

PLEAS HELP!!!!


Re: [Need Help] Error - Torran - 28.02.2010

Show line 98


Re: [Need Help] Error - geerdinho8 - 28.02.2010

92:new TeamInfo[ MAX_TEAMS ][ teaminfo ]= {
93:{ "Varrio Los Aztecas", AZTECAS_COLOR, 0, 0, 0, 0, 0},
94:{ "Los Santos Vagos", VAGOS_COLOR, 0, 0, 0, 0, 0},
95:{ "The Ballas Family", BALLAS_COLOR, 0, 0, 0, 0, 0},
96: { "Grove Street Familie", GROVE_COLOR, 0, 0, 0, 0, 0},
97: { "Los Santos Police Department", COPS_COLOR, 0, 0, 0, 0, 0}
98: };


Re: [Need Help] Error - Torran - 28.02.2010

Try and remove the ; from };


Re: [Need Help] Error - geerdinho8 - 28.02.2010

Get this errors:
Код:
C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\LSTW2Uv1.pwn(98) : error 052: multi-dimensional arrays must be fully initialized
C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\LSTW2Uv1.pwn(103) : error 001: expected token: ";", but found "enum"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: [Need Help] Error - geerdinho8 - 28.02.2010

HELP!


Re: [Need Help] Error - smeti - 28.02.2010

pawn Код:
#define MAX_TEAMS  5

Test FilterScript:
pawn Код:
#include <a_samp>

#define MAX_TEAMS  5
#define AZTECAS_COLOR   0x0066FFAA
#define VAGOS_COLOR     0x0066FFAA
#define BALLAS_COLOR    0x0066FFAA
#define GROVE_COLOR     0x0066FFAA
#define COPS_COLOR      0x0066FFAA

enum teaminfo
{
    blabla[32],
    teamcolor,
    num1,
    num2,
    num3,
    num4,
    num5,
};

new TeamInfo[MAX_TEAMS][teaminfo] =
{
    { "Varrio Los Aztecas", AZTECAS_COLOR, 0, 0, 0, 0, 0}, // Team 1
    { "Los Santos Vagos",  VAGOS_COLOR,  0, 0, 0, 0, 0}, // Team 2
    { "The Ballas Family",  BALLAS_COLOR,  0, 0, 0, 0, 0}, // Team 3
    { "Grove Street Familie",  GROVE_COLOR,  0, 0, 0, 0, 0}, // Team 4
    { "Los Santos Police Department",   COPS_COLOR,   0, 0, 0, 0, 0} // Team 5
};

public OnFilterScriptInit()
{
    print("\n");
    for(new i; i < sizeof TeamInfo; i++)
    {
        printf("    %s | %x | %d | %d | %d | %d | %d |", TeamInfo[i][blabla], TeamInfo[i][teamcolor], TeamInfo[i][num1], TeamInfo[i][num2], TeamInfo[i][num3], TeamInfo[i][num4], TeamInfo[i][num5]);
    }
    print("\n");
    return 1;
}
pawn Код:
#define MAX_TEAMS  6

// : error 052: multi-dimensional arrays must be fully initialized