07.03.2013, 09:26
So basically it shows only Server has close connection it doesn't send message about that he needs to change his name to Roleplay name!
pawn Код:
new name[MAX_PLAYER_NAME+1], str[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, red, "SERVER: {FFFFFF}This is a RP Server, please reconnect using Firstname_Lastname format.");
SendClientMessage(playerid, red, "SERVER: {FFFFFF}Also, please remove the numbers and/or tags in your name.");
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "%s has been kicked from the server for having a Non-RP name.", name);
SendClientMessageToAll(0xC4C4C4FF, str);
Kick(playerid);
}
// No Underscore
if(strfind( name, "_", true) == -1)
{
SendClientMessage(playerid, red, "SERVER: {FFFFFF}This is a RP Server, please reconnect using Firstname_Lastname format.");
format(str, sizeof(str), "%s has been kicked from the server for having a Non-RP name.", name);
SendClientMessageToAll(0xC4C4C4FF, str);
Kick(playerid);
}