Error 009
#1

Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
Код:
gamemodes\FirstScript.pwn(36) : error 009: invalid array size (negative, zero or out of bounds)
Reply
#2

more info ?

EDITost here line 36
Reply
#3

Quote:
Originally Posted by `'DokerJr'`
more info ?

EDITost here line 36
This is line 36
Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
i added the enum for pInfo..

is there anything i can do to fix it?
Reply
#4

why you added [pInfo]?
Reply
#5

Quote:
Originally Posted by `'DokerJr'`
why you added [pInfo]?
Код:
public IsACop(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	  new leader = PlayerInfo[playerid][pLeader];
	  new member = PlayerInfo[playerid][pMember];
	  if(member==1 || member==2)
		{
		  return 1;
		}
		else if(leader==1 || leader==2)
		{
 		 return 1;
		}
	}
	return 0;
}
Reply
#6

enum Your_Enum_Here[] { // Fail

enum Your_Enum_Here { // win

?

Reply
#7

Quote:
Originally Posted by BMUK
enum Your_Enum_Here[] { // Fail

enum Your_Enum_Here { // win

?

Код:
enum pInfo
Reply
#8

He means that you are supposed to declare a enum:
pawn Код:
enum pInfo
{
  pID,
  pFaction,
  pAdmin,
  pBlah
};
new PlayerInfo[MAX_PLAYERS][pInfo];
Thats how you declare a enum and there should be no error at all, unless you are doing something wrong. So post your full enum here if you want help, COMPLETE one. Like the example I posted.
Reply
#9

Код:
enum pInfo
{
	pKey[128],
	pPlayerInfo,
	pLevel,
	pAdmin,
	pDonateRank,
	gPupgrade,
	pConnectTime,
	pReg,
	pSex,
	pAge,
	pOrigin,
	pCK,
	pMuted,
	pExp,
	pCash,
	pAccount,
	pCrimes,
	pKills,
	pDeaths,
	pArrested,
	pWantedDeaths,
	pPhoneBook,
	pLottoNr,
	pFishes,
	pBiggestFish,
	pJob,
	pPayCheck,
	pHeadValue,
	pJailed,
	pJailTime,
	pMats,
	pDrugs,
	pLeader,
	pMember,
	pFMember,
	pRank,
	pChar,
	pContractTime,
	pDetSkill,
	pSexSkill,
	pBoxSkill,
	pLawSkill,
	pMechSkill,
	pJackSkill,
	pCarSkill,
	pNewsSkill,
	pDrugsSkill,
	pCookSkill,
	pFishSkill,
	Float:pHealth,
	Float:pSHealth,
	pInt,
	pLocal,
	pTeam,
	pModel,
	pPnumber,
	pPhousekey,
	pPbiskey,
	Float:pPos_x,
	Float:pPos_y,
	Float:pPos_z,
	pCarLic,
	pFlyLic,
	pBoatLic,
	pFishLic,
	pGunLic,
	pGun1,
	pGun2,
	pGun3,
	pGun4,
	pAmmo1,
	pAmmo2,
	pAmmo3,
	pAmmo4,
	pCarTime,
	pPayDay,
	pPayDayHad,
	pCDPlayer,
	pWins,
	pLoses,
	pAlcoholPerk,
	pDrugPerk,
	pMiserPerk,
	pPainPerk,
	pTraderPerk,
	pTut,
	pMissionNr,
	pWarns,
	pAdjustable,
	pFuel,
	pMarried,
	pMarriedTo[128],
};
Reply
#10

Alright, looking at your enum, I can already assume whats wrong. So, lets have a closer look.

Код:
This symbol indicates that there is more variables within the enum: ,
You use a comma and another one.. until you reach the end.

E.g:
pawn Код:
enum pInfo
{
  pID, // We want another variable, comma at the end
  pKillerID, // We want another variable, comma at the end
  pFaction, // We want another variable, comma at the end
  pAdmin // We dont want another variable, no comma
};
Well, I am sure you will figure your problem alone by now.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)