25.08.2014, 11:50
Fast auto non roleplay name detector and auto kicker .
Код:
public OnPlayerConnect(playerid) { new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1]; GetPlayerName(playerid, name, sizeof(name)); // Has numbers if(strfind(name, "0", true) != -1 || strfind(name, "1", true) != -1 || strfind(name, "2", true) != -1 || strfind(name, "3", true) != -1 || strfind(name, "4", true) != -1 || strfind(name, "5", true) != -1 || strfind(name, "6", true) != -1 || strfind(name, "7", true) != -1 || strfind(name, "8", true) != -1 || strfind(name, "9", true) != -1 || strfind(name, "[", true) != -1 || strfind(name, "]", true) != -1) { SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}This is a RP Server, please reconnect using Firstname_Lastname format."); SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Also, please remove the numbers and/or tags in your name."); new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s has been kicked from the server for having a Non-RP name.", name); SendClientMessageToAll(0xC4C4C4FF, string); Kick(playerid); } // No Underscore if(strfind( name, "_", true) == -1) { SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}This is a RP Server, please reconnect using Firstname_Lastname format."); format(string, sizeof(string), "%s has been kicked from the server for having a Non-RP name.", name); SendClientMessageToAll(0xC4C4C4FF, string); Kick(playerid); } return 1; }