Problem with nick
#1

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. ?
Reply
#2

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.
Reply
#3

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.
Reply
#4

Don't use strfind. Every nickname that contains the string "con" will get kicked. Use strcmp instead.

https://sampwiki.blast.hk/wiki/Strcmp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)