24.01.2011, 15:07
I declared the array as constant (constant variables are handled faster than normal variables)
You forgot the second closing bracket and the forbidden names in strcmp
pawn Код:
stock const ForbiddenNames[][] =
{
"1", "2", "3", "4", "5"
};
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;
}
}