18.06.2012, 16:04
I keep getting:
For this piece of code:
I'm trying to make a inventory system where if one slot is not filled it fills it, and each item has a specific amount. Any ideas how to fix this?
Quote:
error 001: expected token: "-identifier-", but found "-integer value-" |
Код:
new A1[20]; if(PlayerInfo[targetid][pAmount1] == 1) { A1 = PlayerInfo[targetid][pWood]; } else if(PlayerInfo[targetid][pAmount1] == 2) { A1 = PlayerInfo[targetid][pFruit]; } else if(PlayerInfo[targetid][pAmount1] == 3) { A1 = PlayerInfo[targetid][pSeeds]; } else if(PlayerInfo[targetid][pAmount1] == 4) { A1 = PlayerInfo[targetid][pLeather]; } else if(PlayerInfo[targetid][pAmount1] == 5) { A1 = PlayerInfo[targetid][pHide]; } else if(PlayerInfo[targetid][pAmount1] == 6) { A1 = PlayerInfo[targetid][pMeat]; } else if(PlayerInfo[targetid][pAmount1] == 7) { A1 = PlayerInfo[targetid][pClothes]; } else if(PlayerInfo[targetid][pAmount1] == 8) { A1 = PlayerInfo[targetid][pCopper]; } else if(PlayerInfo[targetid][pAmount1] == 9) { A1 = PlayerInfo[targetid][pIron]; } else if(PlayerInfo[targetid][pAmount1] == 10) { A1 = PlayerInfo[targetid][pGold]; } else if(PlayerInfo[targetid][pAmount1] == 11) { A1 = PlayerInfo[targetid][pCoal]; } else if(PlayerInfo[targetid][pAmount1] == 12) { A1 = PlayerInfo[targetid][pCookedFish]; } else if(PlayerInfo[targetid][pAmount1] == 13) { A1 = PlayerInfo[targetid][pPerch]; } else if(PlayerInfo[targetid][pAmount1] == 14) { A1 = PlayerInfo[targetid][pSalmon]; } else if(PlayerInfo[targetid][pAmount1] == 15) { A1 = PlayerInfo[targetid][pTuna]; } else if(PlayerInfo[targetid][pAmount1] == 16) { A1 = PlayerInfo[targetid][pSwordfish]; } else if(PlayerInfo[targetid][pAmount1] == 17) { A1 = PlayerInfo[targetid][pWheat]; } else if(PlayerInfo[targetid][pAmount1] == 18) { A1 = PlayerInfo[targetid][pBread]; } else if(PlayerInfo[targetid][pAmount1] == 19) { A1 = PlayerInfo[targetid][pString]; } else if(PlayerInfo[targetid][pAmount1] == 20) { A1 = PlayerInfo[targetid][pArrow]; } else if(PlayerInfo[targetid][pAmount1] == 21) { A1 = PlayerInfo[targetid][pWater]; } else { A1 = "Nothing"; }