17.11.2011, 20:27
pawn Код:
stock IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
if(string[i] > '9' || string[i] < '0') return 0;
return 1;
}
new len = strlen(text[pos]);
new count = 0;
new name[MAX_PLAYER_NAME];
for (new i = 0; i <MAX_PLAYERS; i++) {
if (IsPlayerConnected(i)) {
GetPlayerName(i, name, sizeof (name));
if (strcmp(name, text[pos], true, len) == 0) {
if (len == strlen(name)) {
return i;
}
else {
count++;
userid = i;
}
}
}
}
if (count != 1) {
if (playerid != INVALID_PLAYER_ID) {
if (count){SendClientMessage(playerid, VERMELHO, "{FF1493}[ADMIN SYSTEM]{FF0000} Vбrios jogadores encontrados, por favor, procure com mais especificaзгo.");}
else{SendClientMessage(playerid, VERMELHO, "{FF1493}[ADMIN SYSTEM]{FF0000} Nenhum jogador correspondente encontrado.");}
userid = INVALID_PLAYER_ID;
}
return userid;
}
stock IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++){if (string[i] > '9' || string[i] < '0') return 0;}
return 1;
}