Unaccpetable names
#3

I declared the array as constant (constant variables are handled faster than normal variables)
pawn Код:
stock const ForbiddenNames[][] =
{
 "1", "2", "3", "4", "5"
};
You forgot the second closing bracket and the forbidden names in strcmp
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
for(new i; i != sizeof(ForbiddenNames); i ++ )
{
    if(!strcmp(name, ForbiddenNames[i], true))
    {
        SendClientMessage(playerid, 0xFF0000FF, "SERVER: Unacceptable Name");
        SendClientMessage(playerid, 0xFF0000FF, "SERVER: You have Been Banned.");
        Ban(playerid);
        break;
    }
}
Reply


Messages In This Thread
Unaccpetable names - by Fool - 24.01.2011, 12:15
Re: Unaccpetable names - by blackwave - 24.01.2011, 14:50
AW: Unaccpetable names - by Nero_3D - 24.01.2011, 15:07
Nero_3D - by Fool - 24.01.2011, 15:35
Re: Unaccpetable names - by Fool - 24.01.2011, 16:36
Re: Unaccpetable names - by Mean - 24.01.2011, 16:41
Re: Unaccpetable names - by Fool - 24.01.2011, 16:51

Forum Jump:


Users browsing this thread: 1 Guest(s)