Array-Problem
#1

'Sup y'all?

I get this 2 errors because of my arrays I've just defined:

Код:
D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(263) : error 052: multi-dimensional arrays must be fully initialized
D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(305) : error 052: multi-dimensional arrays must be fully initialized
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
I've commented the line(s):

PHP код:
new TeamInfoMAX_TEAMS ][ teaminfo ] = {
"Grove Street",  TEAM_GROVE_COLOR,  00000},
"Ballas",    TEAM_BALLA_COLOR,    00000},
"Vagos",   TEAM_VAGOS_COLOR,   00000},
"Aztecas",   TEAM_AZTECAS_COLOR,    00000},
"Police",  TEAM_POLICE_COLOR,  00000},
"San Fierro Rifas",   TEAM_RIFAS_COLOR,     00000},
"Loco Syndicato",   TEAM_LOCO_COLOR,   00000}
}; 
//the first one 
PHP код:
new turfsMAX_TURFS ][ tinfo ] = {
{  
0"Ganton",            2083.306884, -1757.8403322643.306884, -1573.840332TEAM_GROVE_COLOR,    GROVE,    -1000},
{  
1"Idlewood",            2380.865966, -2001.5545652644.865966, -1737.554565TEAM_GROVE_COLOR,    GROVE,    -1000},
{  
2"Ganton",          2145.166259, -1995.3448482385.166259, -1755.344848TEAM_GROVE_COLOR,    GROVE,     -1000},
{  
3"Glenpark",          1783.376220, -1398.9637452327.376220, -1030.963745TEAM_BALLA_COLOR,     BALLA,     -1000},
{  
4"Jefferson",          1564.102172, -1224.4212641892.102172, -1032.421264TEAM_BALLA_COLOR,     BALLA,     -1000},
{  
5"Glenpark",          1556.644531, -1398.0701901788.644531, -1222.070190TEAM_BALLA_COLOR,    BALLA,    -1000},
{  
6"East Los Santos",          2389.563720, -1238.9085692893.563720, -1046.908569TEAM_VAGOS_COLOR,    VAGOS,    -1000},
{  
7"Los Flores",          2327.079345, -1324.8597412391.079345, -1044.859741TEAM_VAGOS_COLOR,     VAGOS,     -1000},
{  
8"East Los Santos",      2369.286132, -1432.1903072705.286132, -1208.190307TEAM_VAGOS_COLOR,  VAGOS,  -1000},
{  
9"Willowfield",      1636.727661, -2174.6828612148.727539, -1950.682861TEAM_AZTECAS_COLOR,  AZTECAS,  -1000},
10"El Corona",      1801.938842, -1965.2816162089.938964, -1741.281616TEAM_AZTECAS_COLOR,  AZTECAS,  -1000},
11"Willowfield",      2073.393798, -2143.4470212409.393798, -1991.447021TEAM_AZTECAS_COLOR,    AZTECAS,    -1000},
12"Commerce",         1279.003295, -1740.6058341831.003295, -1588.605834TEAM_POLICE_COLOR,   POLICE,   -1000},
13"Idlewood",         1355.672607, -1599.5373531563.672607, -1007.537353TEAM_POLICE_COLOR,   POLICE,   -1000},
14"Commerce",         1563.951049, -1595.3974601931.951049, -1499.397460TEAM_POLICE_COLOR,   POLICE,   -1000},
15"Los Santos International",   1354.048217, -2387.1762691666.048217, -2179.176269TEAM_RIFAS_COLOR,    RIFAS,    -1000},
16"Los Santos International",   1648.131103, -2333.5400391888.131103, -2245.540039TEAM_RIFAS_COLOR,    RIFAS,    -1000},
17"Los Santos International",   1368.555419, -2624.9438472256.555419, -2376.943847TEAM_RIFAS_COLOR,   RIFAS,   -1000},
18"Market",   1029.579833, -1608.9549561357.579833, -1136.954956TEAM_LOCO_COLOR,   LOCO,   -1000},
19"Verona Beach",   992.831542, -1859.5430901288.831542, -1603.543090TEAM_LOCO_COLOR,   LOCO,   -1000},
20"Market",   1286.829345, -1878.9775391806.829345, -1726.977539TEAM_LOCO_COLOR,   LOCO,   -1000}
}; 
//the second one 
Reply
#2

Try deleting MAX_TEAMS and MAX_TURFS:

pawn Код:
new TeamInfo[][teaminfo] = {

new turfs[][tinfo] = {
Reply
#3

Already fixed it by myself earlier, but thank you anyways!^^ But, I still got another problem which needs to be fixed as soon as possible! After adding some stuff to my gamemode, whatever I say in any team is displayed in an orange color! Usually, the player which is chatting should have HIS color of his team, but it doesn't matter in which team I'm playing, the chat returns always an orange color! Here is the callback for it, what could it cause?

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(PlayerInfo[playerid][pAdmin] == 0 && !IsPlayerAdmin(playerid))
    {
        #if AntiSpam == true
        if(PlayerInfo[playerid][SpamCount] == 0) PlayerInfo[playerid][SpamTime] = TimeStamp();
        PlayerInfo[playerid][SpamCount]++;
        if(TimeStamp() - PlayerInfo[playerid][SpamTime] > SPAM_TIME)
        {
            PlayerInfo[playerid][SpamCount] = 0;
            PlayerInfo[playerid][SpamTime] = TimeStamp();
        }
        else if(PlayerInfo[playerid][SpamCount] == MAX_SPAM_MSG)
        {
            new string[256];
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,name,sizeof(name));
            SpamKickLog(playerid);
            format(string,sizeof(string),"Player %s (ID:%d) has been automatically kicked! (Reason: Spamming)", name,playerid);
            SendClientMessageToAll(COLOR_RED,string);
            Kick(playerid);
        }
        else if(PlayerInfo[playerid][SpamCount] == MAX_SPAM_MSG-1)
        {
            SendClientMessage(playerid,COLOR_RED,"ATTENTION: Next spam warning will result in a kick!");
            return 0;
        }
        #endif
    }
   
    if(text[0] == '#')
    {
        if(PlayerInfo[playerid][pAdmin] >= 1)
        {
            new str[128], name[24];
            GetPlayerName(playerid, name, 24);
            format(str, 128, "[ADMIN CHAT] %s(%d): %s", name,playerid, text[1]);
            SendMessageToAdmins(COLOR_LIGHTBLUE,str);
            return 0;
        }
        return 1;
    }

    new string[256];
        new playername[MAX_PLAYER_NAME];
        if(text[0] == '!' && text[1] != 0)
        {
            GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
            format(string,128,"[Team-Chat] %s: %s", playername,text[1] );
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i) && gTeam[playerid] == gTeam[i])
                    SendClientMessage(i,COLOR_YELLOW,string);
            }
            return 0;
            }


 // I think it starts here...
    new textmsg[128];
    format(textmsg, sizeof(textmsg), "(%d): %s", playerid, text);
    SendPlayerMessageToAll(playerid, textmsg);
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)