Help with strcmp, nick.
#2

You can either capitalize (or minimize) both and compare them:

Here is a function i use to capitalize names (you can use tolower to minimize)
Код:
stock Capitalize(name[])
{
    new string[MAX_PLAYER_NAME+1];
    for (new i, j = strlen(name); i < j; i++)
    {
        format(string, sizeof (string), "%s%c", string, toupper(name[i]));
    }
    return string;
}
Or you can easily set the ignore case to true so it wont matter if its capitalized or not in strcmp:

Код:
strcmp(const string1[], const string2[], bool:ignorecase, length)
Quote:

When set to true, the case doesn't matter - HeLLo is the same as Hello. When false, they're not the same.

Reply


Messages In This Thread
[+REP] Help With Me Playernick, Using strcmp - by Airman123 - 05.06.2015, 04:43
Re: Help with strcmp, nick. - by Evocator - 05.06.2015, 06:18
Re: Help with strcmp, nick. - by Airman123 - 05.06.2015, 06:21

Forum Jump:


Users browsing this thread: 1 Guest(s)