Error 032 -
#1

Код HTML:
(2070) : error 032: array index out of bounds (variable "PlayerInfo")
^ ERROR

Код HTML:
new PlayerInfo[MAX_PLAYERS][pInfo];
What is wrong?
Reply
#2

Show line 2070
Reply
#3

Must be something wrong in your pInfo enum. Show us your pInfo enum.
Reply
#4

I think that means you are trying to use an Index in PlayerInfo array that doesnt exist...

For example you have:

#define MAX_PLAYERS 50

new PlayerInfo[MAX_PLAYERS][pInfo];

And SOMWHERE you are doing this:

PlayerInfo[51][money] = 1000;

or

PlayerInfo[65535][money] = 1000;
In this case, 65535 = INVALID_PLAYER_ID
Reply
#5

THAT IS CMD:
Код HTML:
CMD:asetleader(playerid, params[])
{
	new
	id, pID, string[128];
    if(PlayerInfo[playerid][pAdmin] < 8) return SCM(playerid, COLOR_GREY,"Nu esti autorizat pentru aceasta comanda.");
    if(sscanf(params, "du", id, pID)) return SendClientMessage(playerid, COLOR_GREY, "[Usage:] /asetleader [factionID] [playerid/partofname]");
    if(!IsPlayerConnected(pID)) return SCM(playerid, COLOR_LIGHTRED,"Acest jucator nu este conectat");
	if(id < 1 || id > 10 ) return SCM(playerid, COLOR_LIGHTRED, "ID Factiune Invalid.");

	FactionInfo[id][fLeader] = GetName(pID);
	PlayerInfo[pID][fRank] = 7;
	PlayerInfo[pID][pFaction] = id;
	FactionInfo[id][fMembers] += 1;
 	new file4[40];
 	format(file4, sizeof(file4), FPATH, id);
 	new INI:File = INI_Open(file4);
 	INI_SetTag(File,"data");
 	INI_WriteString(File,"Leader", FactionInfo[id][fLeader]);
 	INI_WriteInt(File,"Members", FactionInfo[id][fMembers]);
 	INI_Close(File);
	format(string, sizeof(string), "LEADER: L-ai pus pe  %s lider la factiunea %s.", GetName(pID), FactionInfo[id][fName]);
	SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
}
AND THAT IS ERROR LINE:
Код HTML:
	PlayerInfo[playerid][fRank] = 7;
And pInfos

Код HTML:
enum pInfo
{
    pPass,
    pCash,
	pKills,
	pDeaths,
    pAdmin,
    pSex,
    pAge,
   	Float:pPos_x,
	Float:pPos_y,
	Float:pPos_z,
	pSkin,
	pFaction,

}
Reply
#6

fRank is not part of pInfo(Enum)..

The reason for the error is:>
PlayerInfo[pID][fRank] = 7;

Either make a pRank inside pInfo and change accordingly.. Or edit the mistake..
Reply
#7

Quote:
Originally Posted by Mic_H
Посмотреть сообщение
fRank is not part of pInfo(Enum)..

The reason for the error is:>
PlayerInfo[pID][fRank] = 7;

Either make a pRank inside pInfo and change accordingly.. Or edit the mistake..
Thank you very much man!
Reply
#8

adada
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)