03.06.2012, 00:30
how can i make a thingy that allows a name with FirstName_LastName format..cauze i made one and it makes server restart..
if(AntiName == 1)
{
if(namestring == -1)
{
format(string, sizeof(string),"%s, a primit Kick de la Name_BOT!",name);
SendClientMessageToAll(COLOR_RED, string);
SendClientMessage(playerid, COLOR_YELLOW, "Ministru: Nu iti putem accepta numele.");
SendClientMessage(playerid, COLOR_YELLOW, "Hint: Numele tau trebuie sa fie in format Nume_Prenume.");
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Anticheat Has Kicked %s for Invalid Name",d,m,y,h,mi,s,name);
KickLog(string);
Kick(playerid);
return 1;
}
}
if(IsPlayerNPC(playerid))
{
SpawnPlayer(playerid);
return 1;
}
This -1 makes the restart if(namestring == -1) - if its 1 or 0 the server is good and doesent work..
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
if(strfind(pName, "_", true) == -1)
{
SendClientMessage(playerid,COLOR_WHITE, "Your name must be in this format: Firstname_Lastname Format. (Example: Bob_Jones)");
Kick(playerid);
return 1;
}
Here's one I made, by the way, it's tested and working.
pawn Код:
|