(2070) : error 032: array index out of bounds (variable "PlayerInfo")
new PlayerInfo[MAX_PLAYERS][pInfo];
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;
}
PlayerInfo[playerid][fRank] = 7;
enum pInfo
{
pPass,
pCash,
pKills,
pDeaths,
pAdmin,
pSex,
pAge,
Float:pPos_x,
Float:pPos_y,
Float:pPos_z,
pSkin,
pFaction,
}
|
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.. |