SA-MP Forums Archive
Error 032 - - 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)
+--- Thread: Error 032 - (/showthread.php?tid=629217)



Error 032 - - VixxeN - 22.02.2017

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

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


Re: Error 032 - - iamjems - 22.02.2017

Show line 2070


Re: Error 032 - - Unte99 - 22.02.2017

Must be something wrong in your pInfo enum. Show us your pInfo enum.


Re: Error 032 - - Yousha - 22.02.2017

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


Re: Error 032 - - VixxeN - 22.02.2017

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,

}



Re: Error 032 - - Mic_H - 22.02.2017

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..


Re: Error 032 - - VixxeN - 22.02.2017

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!


Re: Error 032 - - VixxeN - 22.02.2017

adada