[Help] error 033 : array must be indexed [Very Hard to solve]
#1

Type of gamemode : cynix tdm <from scratch>
Errors :
Код:
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(583) : error 033: array must be indexed (variable "pDeaths")
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(584) : error 033: array must be indexed (variable "pKillz")
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(586) : error 033: array must be indexed (variable "PlayerVip")
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1701) : error 033: array must be indexed (variable "PlayerVip")
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1717) : error 033: array must be indexed (variable "PlayerVip")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
My enum pinfo :

Код:
enum pInfo
{
 * *pAdminLevel,
 * *pNovac, // it means pMoney
 * *pAFK,
 * *pLevel,
};
my OnPlayerDisconnect :

Код:
public OnPlayerDisconnect(playerid, reason)
{
 * *new name[MAX_PLAYER_NAME], file[256];
 * *GetPlayerName(playerid, name, sizeof(name));
 * *format(file, sizeof(file), SERVER_USER_FILE, name);
 * *if(gPlayerLogged[playerid] == 1)
 * *{
 * * * *dini_IntSet(file, "Level", PlayerInfo[playerid][pLevel]);
 * * * *dini_IntSet(file, "Novac", PlayerInfo[playerid][pNovac]);
 * * * *dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
 * * * *dini_IntSet(file, "AFK", PlayerInfo[playerid][pAFK]);
 * * * *dini_IntSet(file, "Ubojstava", PlayerInfo[playerid][pKillz]);
 * * * *dini_IntSet(file, "Smrti",PlayerInfo[playerid][pDeaths]);
 * * * *dini_IntSet(file, "VIPLevel",PlayerInfo[playerid][PlayerVip]);
 * *}
 * *gPlayerLogged[playerid] = 0;
	return 1;
}
So,how can I solve these errors?
If you need something else to help me,i will post.
I asked on 2 sa:mp forums,and they didn't know how to or didn't wanted to help me to solve the errors.

And ofcourse,sorry for my bad english..
Reply
#2

pawn Код:
enum pInfo
{
    pAdminLevel,
    pNovac, // it means pMoney
    pAFK,
    pLevel
}
Reply
#3

it's showing same errors..
Reply
#4

Did you actually made 'new PlayerInfo[MAX_PLAYERS][pInfo];'?
Reply
#5

yes i did,it is right behind end of enum,it's like this

Код:
/*---- [DEFINICIJA IGRACA] ----*/
enum pInfo
{
    pAdminLevel,
    pNovac,
    pAFK,
    pLevel
};
new PlayerInfo[MAX_PLAYERS][pInfo];
new gPlayerLogged[MAX_PLAYERS];
Reply
#6

Fix MAX_PLAYERS ..
pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS (YOUR_SLOTS_SERVER_HERE)

// and fix enum
enum pInfo
{
    pAdminLevel,
    pNovac,
    pAFK,
    pLevel,
    pKillsz,
   pDeaths,
   PlayerVip
};
Reply
#7

Can you show all the error lines please?
Reply
#8

no,it didn't helped.

Errors & Warnings (i know i have much of it..)

Код:
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(525) : warning 235: public function lacks forward declaration (symbol "Registracija")
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(584) : error 033: array must be indexed (variable "pKillz")
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(585) : error 033: array must be indexed (variable "pDeaths")
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(586) : error 033: array must be indexed (variable "PlayerVip")
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(594) : warning 211: possibly unintended assignment
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(803) : warning 202: number of arguments does not match definition
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(813) : warning 217: loose indentation
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(815) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(815) : warning 219: local variable "file" shadows a variable at a preceding level
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(815) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(819) : warning 202: number of arguments does not match definition
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(824) : warning 202: number of arguments does not match definition
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(815) : warning 204: symbol is assigned a value that is never used: "string"
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1637) : warning 204: symbol is assigned a value that is never used: "cmd"
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1658) : warning 217: loose indentation
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1659) : warning 204: symbol is assigned a value that is never used: "cmd"
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1701) : error 033: array must be indexed (variable "PlayerVip")
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1713) : warning 209: function "cmd_nitro" should return a value
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1717) : error 033: array must be indexed (variable "PlayerVip")
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1722) : warning 217: loose indentation
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1727) : warning 217: loose indentation
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1815) : warning 217: loose indentation
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1816) : warning 213: tag mismatch
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1816) : warning 213: tag mismatch
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1816) : warning 213: tag mismatch
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1832) : warning 217: loose indentation
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(1863) : warning 217: loose indentation
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(2222) : warning 202: number of arguments does not match definition
C:\Users\Snjezana\Desktop\Ivanovo (nemoj brisat)\Cynix DM\gamemodes\CDM.pwn(2222) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
edit 2# :

Код:
enum pInfo
{
    pAdminLevel,
    pNovac,
    pAFK,
    pLevel,
    pKillsz,
   pDeaths,
   PlayerVip // it is defined in VIP include already.
};
Reply
#9

Look my psot edit:
pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS (YOUR_SLOTS_SERVER_HERE)

// and fix enum
enum pInfo
{
    pAdminLevel,
    pNovac,
    pAFK,
    pLevel,
    pKillsz,
   pDeaths,
   PlayerVip
};
// not it new pDeaths and  new pKillz !!
_
EDIT:
Post the line of errosrs
Reply
#10

PHP код:
enum pInfo
{
 
pAdminLevel,
 
pNovac,
 
pAFK,
 
pLevel,
 
pDeaths,
 
PlayerVip,
 
pKillz,
}; 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)