INVALID NICK.
#1

HI. Where is problem:

Код:
stock InvalidNickKick(playerid)
{
    new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
    new where = strfind(name,"_",true);
    new lenght = strlen(name)-1;
    new invalid = strfind(name,"[",true);
    if(invalid == -1) invalid = strfind(name,"]",true);

    if(where == 0 || where == lenght || where==-1)
    {
	    SendClientMessage(playerid,COLOR_ORANGE,"* SERVER: Name_Lastname");
	    Kick(playerid);
	    return 1;
	}

	if(strlen(name[where])<4)
 	{
  		SendClientMessage(playerid,COLOR_ORANGE,"* SERVER: your lastname is too short");
  		Kick(playerid);
  		return 1;
 	}

	if(where<3)
 	{
  		SendClientMessage(playerid,COLOR_ORANGE,"* SERVER: your firstname is too short");
  		Kick(playerid);
  		return 1;
 	}
 	
	if(invalid != -1)
 	{
  		SendClientMessage(playerid,COLOR_ORANGE,"* SERVER: invalids letters in your name");
  		Kick(playerid);
		return 1;
 	}
 	return 0;
}
How to make player can come only with that name:

Код:
Aasdas_Asdasd
Because he can come with that nick:

Код:
AASDAS_ASDASD
Reply


Messages In This Thread
INVALID NICK. - by budelis - 21.07.2012, 12:39
Re: INVALID NICK. - by budelis - 21.07.2012, 14:49
Re: INVALID NICK. - by Derelict - 21.07.2012, 16:42
Re: INVALID NICK. - by budelis - 22.07.2012, 14:16
Re: INVALID NICK. - by [MM]RoXoR[FS] - 22.07.2012, 14:36

Forum Jump:


Users browsing this thread: 1 Guest(s)