SA-MP Forums Archive
Error 009 - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error 009 (/showthread.php?tid=102212)



Error 009 - Ritchie999 - 14.10.2009

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



Re: Error 009 - DokerJr - 14.10.2009

more info ?

EDITost here line 36


Re: Error 009 - Ritchie999 - 14.10.2009

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?


Re: Error 009 - DokerJr - 14.10.2009

why you added [pInfo]?


Re: Error 009 - Ritchie999 - 14.10.2009

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;
}



Re: Error 009 - BMUK - 14.10.2009

enum Your_Enum_Here[] { // Fail

enum Your_Enum_Here { // win

?




Re: Error 009 - Ritchie999 - 14.10.2009

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

enum Your_Enum_Here { // win

?

Код:
enum pInfo



Re: Error 009 - Extremo - 14.10.2009

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.


Re: Error 009 - Ritchie999 - 14.10.2009

Код:
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],
};



Re: Error 009 - Extremo - 14.10.2009

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.