Surename tag
#1

I saw some server have like Surename kicking system. As like, I am owner of Alex_Smith. If anyone want to join in the server, as ****_Smith , He will kick out . I want to make same system Like this. Can anyone help me about that.
I have tried to find in everywhere in this forum. But cannot seen. Would you please help me for it?

And also If i use a cmd or something else to make a surename , Even the registration system!
Reply
#2

Hardly need. Please reply
Reply
#3

Код:
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.
Reply
#4

nvm, someone was faster.
Reply
#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
#6

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.
Can you give me a whole FS for it? If not no problem. Anyway Thanks
Reply
#7

Why would you need a FS? Just take the code and place it in your GM
Reply
#8

Quote:
Originally Posted by Sime30
Посмотреть сообщение
Why would you need a FS? Just take the code and place it in your GM
I want to make a cmd system too. like If i add /surename (Id) (Name) . So I can easily can manage them. not with a huge time taking compile. Becuase my script is 15.6MB( AMX ) 132750lines. thats why. If it a FS, I can easily compile or manage it
Reply
#9

Quote:
Originally Posted by SoFahim
Посмотреть сообщение
I want to make a cmd system too. like If i add /surename (Id) (Name) . So I can easily can manage them. not with a huge time taking compile. Becuase my script is 15.6MB( AMX ) 132750lines. thats why. If it a FS, I can easily compile or manage it
So wait, If I get this correctly, you cant script this simple thing yet you managed to copy and paste 130k lines together? bro, you need to learn scripting and optimize that. 15.6mb isnt normal for a script. I can probably make that script into 15k lines max.
Reply
#10

Quote:
Originally Posted by notime
Посмотреть сообщение
So wait, If I get this correctly, you cant script this simple thing yet you managed to copy and paste 130k lines together? bro, you need to learn scripting and optimize that. 15.6mb isnt normal for a script. I can probably make that script into 15k lines max.
Man, I coded the Surename one time. But there a lot of errors. and there no one kicking by surename protection. As like if he use Hi_Smith , he don't kicked out. If anyone use _Smith , he got kicked out . thats the last time i remember , I have created one FS about that, but unfortunatly I have lost that. Now i am creating one myself . I thought someone can help me. But no!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)