Surename tag
#5

Quote:
Originally Posted by Harold
Посмотреть сообщение
Код:
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, "_Smith", true) != -1)
	{
		SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You cannot use _Smith here.");
        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);
		Kick(playerid);
	}
}
Should work. I've not coded in years, but yeah.
Why do you use GetPlayerName two times? It is better if you use it one times..
Also you doesn't need to declare this two times too:
PHP код:
new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1]; 
You had declared this on the top of OnPlayerConnect.
Reply


Messages In This Thread
Surename tag - by SoFahim - 16.07.2015, 11:51
Re: Surename tag - by SoFahim - 16.07.2015, 14:19
Re: Surename tag - by Smithy - 16.07.2015, 14:27
Re: Surename tag - by notime - 16.07.2015, 14:32
AW: Surename tag - by Mencent - 16.07.2015, 14:36
Re: Surename tag - by SoFahim - 16.07.2015, 16:54
Re: Surename tag - by Sime30 - 16.07.2015, 17:03
Re: Surename tag - by SoFahim - 16.07.2015, 17:12
Re: Surename tag - by notime - 16.07.2015, 17:23
Re: Surename tag - by SoFahim - 16.07.2015, 17:26

Forum Jump:


Users browsing this thread: 3 Guest(s)