SA-MP Forums Archive
How could I ban certain phrases in names? - 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: How could I ban certain phrases in names? (/showthread.php?tid=570393)



How could I ban certain phrases in names? - Omegas - 09.04.2015

For example on my roleplay server if somebody joins with a name Example_King,
could I make something that would kick him because he has _King in his name?


Re: How could I ban certain phrases in names? - CalvinC - 09.04.2015

Use strfind in OnPlayerConnect.
Example:
Код:
public OnPlayerConnect(playerid)
{
    new name[21];
    GetPlayerName(playerid, name, sizeof(name));
    if(strfind(name, "_King", true) != 0) Kick(playerid);
}
https://sampwiki.blast.hk/wiki/Strfind


Re: How could I ban certain phrases in names? - Omegas - 09.04.2015

Thanks!