08.10.2013, 13:50
Quote:
Well that's actually quite nice, but could you tell me a practical usage for this?
|
pawn Код:
// only example
stock SimilarPlayerID(name[]) {
if(name[0]) {
static szName[MAX_PLAYER_NAME]. i;
for(i = 0; i != MAX_PLAYERS; ++i) {
if(IsPlayerConnected(i)) {
GetPlayerName(i, szName, sizeof szName);
if( similar_text(name, szName) > 50.0 ) { // 50% of similarity
return i;
}
}
}
}
return -1;
}