[Include] similar_text.inc
#9

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
Well that's actually quite nice, but could you tell me a practical usage for this?
Thanks

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;
}
if have a player with name kill_machine and you search kill mach similar_text return the id. Strfind not
Reply


Messages In This Thread
similar_text.inc - by ipsBruno - 07.10.2013, 05:40
AW: similar_text.inc - by BigETI - 07.10.2013, 05:54
Respuesta: AW: similar_text.inc - by ipsBruno - 07.10.2013, 05:56
Re: similar_text.inc - by Jankingston - 07.10.2013, 06:51
Respuesta: Re: similar_text.inc - by ipsBruno - 07.10.2013, 07:25
Re: similar_text.inc - by Vinnyy - 07.10.2013, 10:55
Respuesta: Re: similar_text.inc - by ipsBruno - 07.10.2013, 21:37
Re: similar_text.inc - by Jochemd - 08.10.2013, 13:43
Respuesta: Re: similar_text.inc - by ipsBruno - 08.10.2013, 13:50
Respuesta: similar_text.inc - by ipsBruno - 29.10.2013, 14:10

Forum Jump:


Users browsing this thread: 2 Guest(s)