09.09.2012, 04:56
Guys... could you help me? i really don't get..
this line here:
it says array must be indexed..
and i dont know how to use arrays.
Код:
CMD:inventory(playerid,params[]) { new choice[20][3],InvNum; new string[400],StrSlot1[50],StrSlot2[50]; if(PlayerInfo[playerid][Slot1] == EMPTYSLOT) { format(StrSlot1,sizeof(StrSlot1),"- Empty Slot -"); } if(PlayerInfo[playerid][Slot1] == HEALTHYFRUIT) { format(StrSlot1,sizeof(StrSlot1),"Healthy fruit"); } if(PlayerInfo[playerid][Slot1] == NACHO) { format(StrSlot1,sizeof(StrSlot1),"Nacho\t"); } if(PlayerInfo[playerid][Slot2] == EMPTYSLOT) { format(StrSlot2,sizeof(StrSlot2),"- Empty Slot -"); } if(PlayerInfo[playerid][Slot2] == HEALTHYFRUIT) { format(StrSlot2,sizeof(StrSlot2),"Healthy fruit"); } if(PlayerInfo[playerid][Slot2] == NACHO) { format(StrSlot2,sizeof(StrSlot2),"Nacho\t"); } if(sscanf(params,"si",choice,InvNum)) { SendClientMessage(playerid,GRAD2,"* Inventory [Choice] [Inventory Number] *"); SendClientMessage(playerid,GRAD2,"* Choice: Use, Give, Drop. *"); format(string,sizeof(string),"*Item: [1 %s (%d)]\t[2 %s (%d)] *",StrSlot1,PlayerInfo[playerid][SlotQty1],StrSlot2,PlayerInfo[playerid][SlotQty2]); SendClientMessage(playerid,GRAD2,string); if(choice == "Use") { } return 1; } return 1; }
Код:
if(choice == "Use")
