[Tutorial] [TUT]How to create forbidden names
#5

Instead of a million strfinds, why not do this?

pawn Code:
new ForbiddenNames[][] = {
     "Loser", "Noob", "Admin", "Moderator", "VIP"
};

public OnPlayerConnected(playerid) {
     for(new i = 0; i < sizeof(ForbiddenNames); i ++ ) {
         if(!strcmp(name, i, true)) {
             SendClientMessage(playerid, 0xFF0000FF, "SERVER: That name is not allowed here!");
             SendClientMessage(playerid, 0xFF0000FF, "SERVER: You have kicked");
             Kick(playerid);
         }
     }
     return 1;
}
I don't get why you're using strfind to get someone's banned name. You're just finding a word inside of it, the point was to forbid the name.
Reply


Messages In This Thread
[TUT]How to create forbidden names - by Toni - 19.07.2010, 00:59
Re: [TUT]How to create forbidden names - by Grim_ - 19.07.2010, 01:04
Re: [TUT]How to create forbidden names - by (SF)Noobanatior - 19.07.2010, 01:07
Re: [TUT]How to create forbidden names - by Toni - 19.07.2010, 01:44
Re: [TUT]How to create forbidden names - by Carlton - 19.07.2010, 01:58
Re: [TUT]How to create forbidden names - by Scenario - 19.07.2010, 03:20
Re: [TUT]How to create forbidden names - by Toni - 19.07.2010, 03:24
Re: [TUT]How to create forbidden names - by Scenario - 19.07.2010, 03:25
Re: [TUT]How to create forbidden names - by [HiC]TheKiller - 19.07.2010, 06:31
Re: [TUT]How to create forbidden names - by Grim_ - 19.07.2010, 11:34

Forum Jump:


Users browsing this thread: 1 Guest(s)