29.06.2013, 21:20
In that case you don't need cID, because its value is the same as ClanInfo array index. Also, cName should be an array, because only arrays can hold text. I suggest doing in this way:
Код:
enum ClanDaten { bool:cAvailable=true, cName[20] } new ClanInfo[MAX_CLANS][ClanDaten]; stock CreateClan(playerid, clanname[]) { if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)) { new EmptySlot = FindEmptySlot(); ClanInfo[EmptySlot][cAvailable] = false; format(ClanInfo[EmptySlot][cName], sizeof ClanInfo[EmptySlot][cName], clanname); } } stock FindEmptySlot() { new i = 0; while (i <= MAX_CLANS) { if(!ClanInfo[i][cAvailable]) i++; else break; } if (i == MAX_CLANS) return -1; return i; }