SA-MP Forums Archive
Surename tag - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Surename tag (/showthread.php?tid=581904)



Surename tag - SoFahim - 16.07.2015

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!


Re: Surename tag - SoFahim - 16.07.2015

Hardly need. Please reply


Re: Surename tag - Smithy - 16.07.2015

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


Re: Surename tag - notime - 16.07.2015

nvm, someone was faster.


AW: Surename tag - Mencent - 16.07.2015

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.


Re: Surename tag - SoFahim - 16.07.2015

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


Re: Surename tag - Sime30 - 16.07.2015

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


Re: Surename tag - SoFahim - 16.07.2015

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


Re: Surename tag - notime - 16.07.2015

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.


Re: Surename tag - SoFahim - 16.07.2015

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!