Damn, what's wrong now? Array index...
#1

Me again.

I'm trying to make that a script loads variables (for enum) for each faction from a file. When I paste the script on GameModeInit I get this:

Код:
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(15) : warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(178) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(179) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(180) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(181) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(182) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(183) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(184) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(185) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(186) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(187) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(188) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(189) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(190) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(191) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(192) : error 032: array index out of bounds (variable "Faction1")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(195) : error 032: array index out of bounds (variable "Faction2")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(196) : error 032: array index out of bounds (variable "Faction2")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(197) : error 032: array index out of bounds (variable "Faction2")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(198) : error 032: array index out of bounds (variable "Faction2")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(199) : error 032: array index out of bounds (variable "Faction2")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(200) : error 032: array index out of bounds (variable "Faction2")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(201) : error 032: array index out of bounds (variable "Faction2")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(202) : error 032: array index out of bounds (variable "Faction2")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(203) : error 032: array index out of bounds (variable "Faction2")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(204) : error 032: array index out of bounds (variable "Faction2")
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\GGRP.pwn(205) : error 032: array index out of bounds (variable "Faction2")

This is the code I'm using:

Код:
	// Load faction variables
	
	Faction1[fFaction1][fLeader] = dini_Set(SERVER_FACTION_FILE_1, "Leader");
 	Faction1[fFaction1][fFactionName] = dini_Set(SERVER_FACTION_FILE_1, "FactionName");
  	Faction1[fFaction1][fRank1] = dini_Int(SERVER_FACTION_FILE_1, "Rank1");
   	Faction1[fFaction1][fRank2] = dini_Int(SERVER_FACTION_FILE_1, "Rank2");
    Faction1[fFaction1][fRank3] = dini_Int(SERVER_FACTION_FILE_1, "Rank3");
    Faction1[fFaction1][fRank4] = dini_Int(SERVER_FACTION_FILE_1, "Rank4");
    Faction1[fFaction1][fRank5] = dini_Int(SERVER_FACTION_FILE_1, "Rank5");
    Faction1[fFaction1][fRank6] = dini_Int(SERVER_FACTION_FILE_1, "Rank6");
    Faction1[fFaction1][fRank7] = dini_Int(SERVER_FACTION_FILE_1, "Rank7");
    Faction1[fFaction1][fSkin1] = dini_Int(SERVER_FACTION_FILE_1, "Skin1");
    Faction1[fFaction1][fSkin2] = dini_Int(SERVER_FACTION_FILE_1, "Skin2");
    Faction1[fFaction1][fSkin3] = dini_Int(SERVER_FACTION_FILE_1, "Skin3");
    Faction1[fFaction1][fSkin4] = dini_Int(SERVER_FACTION_FILE_1, "Skin4");
    Faction1[fFaction1][fSkin5] = dini_Int(SERVER_FACTION_FILE_1, "Skin5");
    Faction1[fFaction1][fSkin6] = dini_Int(SERVER_FACTION_FILE_1, "Skin6");


	Faction2[fFaction2][fLeader] = dini_Int(SERVER_FACTION_FILE_2, "Leader");
 	Faction2[fFaction2][fFactionName] = dini_Int(SERVER_FACTION_FILE_2, "FactionName");
  	Faction2[fFaction2][fRank1] = dini_Int(SERVER_FACTION_FILE_2, "Rank1");
   	Faction2[fFaction2][fRank2] = dini_Int(SERVER_FACTION_FILE_2, "Rank2");
    Faction2[fFaction2][fRank3] = dini_Int(SERVER_FACTION_FILE_2, "Rank3");
    Faction2[fFaction2][fRank4] = dini_Int(SERVER_FACTION_FILE_2, "Rank4");
    Faction2[fFaction2][fRank5] = dini_Int(SERVER_FACTION_FILE_2, "Rank5");
    Faction2[fFaction2][fRank6] = dini_Int(SERVER_FACTION_FILE_2, "Rank6");
    Faction2[fFaction2][fRank7] = dini_Int(SERVER_FACTION_FILE_2, "Rank7");
    Faction2[fFaction2][fSkin1] = dini_Int(SERVER_FACTION_FILE_2, "Skin1");
    Faction2[fFaction2][fSkin2] = dini_Int(SERVER_FACTION_FILE_2, "Skin2");
    Faction2[fFaction2][fSkin3] = dini_Int(SERVER_FACTION_FILE_2, "Skin3");
    Faction2[fFaction2][fSkin4] = dini_Int(SERVER_FACTION_FILE_2, "Skin4");
    Faction2[fFaction2][fSkin5] = dini_Int(SERVER_FACTION_FILE_2, "Skin5");
    Faction2[fFaction2][fSkin6] = dini_Int(fiSERVER_FACTION_FILE_2, "Skin6");
This is enum:

Код:
enum fFaction2
{
	fLeader[MAX_PLAYER_NAME],
	fFactionName[50],
    fRank1,
    fRank2,
    fRank3,
    fRank4,
    fRank5,
    fRank6,
    fRank7,
    fSkin1,
    fSkin2,
    fSkin3,
    fSkin4,
    fSkin5,
    fSkin6,
}


// VARIABLES
new PlayerInfo[MAX_PLAYERS][pInfo];
new gPlayerLogged[MAX_PLAYERS];
new pPaycheck;
new paytimer;
new checkpaytimer;
new bool:pMuted[MAX_PLAYERS] = false;
Please help me with this, this is important for my GM.
Reply


Messages In This Thread
Damn, what's wrong now? Array index... - by Outcast - 10.01.2011, 22:30
Re: Damn, what's wrong now? Array index... - by Rizard - 10.01.2011, 22:50
Re: Damn, what's wrong now? Array index... - by Outcast - 10.01.2011, 23:16
Re: Damn, what's wrong now? Array index... - by Rizard - 10.01.2011, 23:55
Re: Damn, what's wrong now? Array index... - by John_F - 11.01.2011, 00:05
Re: Damn, what's wrong now? Array index... - by Outcast - 11.01.2011, 00:19
Re: Damn, what's wrong now? Array index... - by JaTochNietDan - 11.01.2011, 01:04
Re: Damn, what's wrong now? Array index... - by _rAped - 11.01.2011, 01:58
Re: Damn, what's wrong now? Array index... - by Outcast - 11.01.2011, 05:32
Re: Damn, what's wrong now? Array index... - by Rizard - 11.01.2011, 10:01

Forum Jump:


Users browsing this thread: 1 Guest(s)