Getting Errors and I have no Clue why.
#1

Someone please tell me whats wrong with this code. Im familiar with PAWN and the codes, but im still new to some.

I get the Error : error 033:array must be indexed(variable"mage")

Код:
new mage[999];
	    if(PlayerInfo[targetid][pMID] == 1) {mage = 32}
     	else if(PlayerInfo[targetid][pMID] == 2) {mage = 26}
      	else if(PlayerInfo[targetid][pMID] == 3) {mage = 21}
      	else if(PlayerInfo[targetid][pMID] == 4) {mage = 36}
      	else if(PlayerInfo[targetid][pMID] == 5) {mage = 23}
      	else if(PlayerInfo[targetid][pMID] == 6) {mage = 22}
      	else if(PlayerInfo[targetid][pMID] == 7) {mage = 30}
      	else if(PlayerInfo[targetid][pMID] == 8) {mage = 20}
      	else if(PlayerInfo[targetid][pMID] == 9) {mage = 29}
      	else if(PlayerInfo[targetid][pMID] == 10) {mage = 25}
Reply
#2

You create mage as an array so when accessed, you must specify an index, for example:
pawn Код:
new mage[999];
mage[998] = 10; // VALID
mage = 10; // INVALID
If in your case you meant that 999 should be the amount of players, then better use MAX_PLAYERS to create your array:
pawn Код:
new mage[MAX_PLAYERS];
and add an index to your code lines:
pawn Код:
mage[targetid] = 32;
If this is not correct then explain what you are trying to do
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)