23.05.2018, 14:26
Im currently creating a simple faction. Im just curious whats wrong. When I compile I get these 2 errors.
Thats my enum:
And thats the command:
Код:
error 033: array must be indexed (variable "mafiaInfo") error 033: array must be indexed (variable "mafiaInfo")
Код:
enum mafia_Faction { FactionName[20], MafiaLeaderID, MafiaSQL, MafiaMembers, MafiaNONE }; new mafiaInfo[MAX_PLAYERS][mafia_Faction];
Код:
CMD:setmafialeader(playerid,params[]) { new mafiaLevel; new mafiaID; if(IsPlayerAdmin(playerid)) { if(sscanf(params,"ui", mafiaID, mafiaLevel)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /setmafialeader [ID] [0-1]"); mafiaInfo[mafiaID][MafiaLeaderID] = mafiaLevel; SendClientMessage(playerid,COLOR_WHITE, "{FF8200}Information:{FFFFFF} You have been set as leader of the Mafia."); } else { SendClientMessage(playerid,COLOR_RED, "ERROR: You are not allowd to use this command!"); } return 1; } CMD:mafiainvite(playerid, params[]) { if(mafiaInfo[MafiaLeaderID] >= 1) { new mmemberID; if(sscanf(params,"i", mmemberID)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /minvite [ID]"); mafiaInfo[mmemberID][MafiaMembers] = 1; SendClientMessage(playerid,COLOR_ORANGE,"Information:{FFFFFF} Player has been invited!"); SendClientMessage(mmemberID,COLOR_ORANGE,"Information:{FFFFFF} You have joined the Mafia."); } else { SendClientMessage(playerid,COLOR_RED, "ERROR: You are not the Mafia Leader!"); } return 1; } CMD:mafiakick(playerid, params[]) { if(mafiaInfo[MafiaLeaderID] >= 1) { new mkickoutID; if(sscanf(params,"i", mkickoutID)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /mafiakick [ID]"); mafiaInfo[mkickoutID][MafiaNONE] = 1; SendClientMessage(playerid,COLOR_ORANGE,"Information:{FFFFFF} Player has been kicked out!"); SendClientMessage(mkickoutID,COLOR_ORANGE,"Information:{FFFFFF} You have been kicked out of the Mafia!"); } else { SendClientMessage(playerid,COLOR_RED, "ERROR: You are not the Mafia Leader!"); } return 1; }