09.11.2015, 18:10
Код:
CMD:check(playerid, params[]) { if(gLogged[playerid] == 0) return SendLanguageMessage(playerid, COLOR_WHITE, LoginOnlyEN, LoginOnlyRO); if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pHelper] < 1) return SendLanguageMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You are not admin or a helper.", "{FFFFCC}Eroare: Nu esti admin sau helper."); if(AccountLocked[playerid] == 0) return SendLanguageMessage(playerid, COLOR_WHITE, "{FFB870}Error: Your account is locked. Type /unlockacc to unlock it and use this command.", "{FFB870}Eroare: Contul tau este blocat. Scrie /unlockacc pentru a il debloca si pentru a folosi aceasta comanda."); new id[16]; if(sscanf(params, "u[16]",id)) return SendLanguageMessage(playerid, COLOR_WHITE, "{B8DBFF}Synthax: /check <Name/Playerid>","{B8DBFF}Sintaxa: /check <Nume/ID>"); if(!CheckMultipleNames(playerid, id)) return 1; if(id[0] == INVALID_PLAYER_ID) return SendLanguageMessage(playerid, COLOR_WHITE, PlayerOfflineEN, PlayerOfflineRO); if(!IsPlayerConnected(id[0])) return SendLanguageMessage(playerid, COLOR_WHITE, PlayerOfflineEN, PlayerOfflineRO); ShowStats(playerid, id[0]); return 1; } stock CheckMultipleNames(playerid, array[]) { new strfound[180], yesno , foundplayer, name[MAX_PLAYER_NAME]; for(new i = 0; array[i] != INVALID_PLAYER_ID; i++) { GetPlayerName(array[i], name, sizeof(name)); if (array[i] == cellmin) { if(yesno == 0) { SendLanguageMessage(playerid, 0xFFFFFFFF, "{FFFFCC}Too many players matched your search. Use one of these IDs.", "{FFFFCC}Prea multi jucatori corespund cautarii. Foloseste unul dintre aceste ID-uri."); format(strfound, sizeof(strfound), "{FFFFCC}ID: (%d) %s", foundplayer, GetName(foundplayer)); SendClientMessage(playerid, 0xFFFFFFFF, strfound); } yesno ++; format(strfound, sizeof(strfound), "{FFFFCC}ID: (%d) %s", array[i], name); SendClientMessage(playerid, 0xFFFFFFFF, strfound); } foundplayer = array[i]; } if(yesno > 0) return 0; return 1; } I have a problem celmin is always equal "--". But the number of matches is higher than 15, I need to shot Too many matches, how to edit the CheckMultipleNames ?