Problem with nick - 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: Problem with nick (
/showthread.php?tid=578221)
Problem with nick -
ultrAslan - 17.06.2015
Hello
I have a problem with a nick .
Every time when a player named ^con joins the server it starts to freeze . How i can made that server kick the nick automatically. ?
Re: Problem with nick -
AndySedeyn - 17.06.2015
Use the 'strcmp' function to compare '^con' to the player's name upon connection. If the function returns 0 (the function returns 0 when both strings match each other), kick the player.
Re: Problem with nick -
ultrAslan - 17.06.2015
Quote:
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(!strfind(name, "con", true))
{
SendClientMessage(playerid, 0x0000ff, "Name not allowed.");
Kick(playerid);
}
return 1;
}
|
i have this code it works but when i join example with "coner" it kick that nick too.
Re: Problem with nick -
AndySedeyn - 17.06.2015
Don't use strfind. Every nickname that contains the string "con" will get kicked. Use strcmp instead.
https://sampwiki.blast.hk/wiki/Strcmp