Easy Kick if name is question. - 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: Easy Kick if name is question. (
/showthread.php?tid=401180)
Easy Kick if name is question. -
jakejohnsonusa - 22.12.2012
How can I make it in my GM where it kicks a player if the name "officer" is in their nickname?
My server is from a very Law Enforcment centred forum... So lots of people join with the name like Officer_James. Which is un-RP (especially when they aren't even a cop).
Thanks,
jakejohnsonusa
Re: Easy Kick if name is question. -
gtakillerIV - 22.12.2012
Use
strfind under OnPlayerRequestClass.
Ex:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
new name[24];
GetPlayerName(playerid, name, sizeof(name));
if(strfind(name, "officer", true) != -1)
{
SendClientMessage(playerid, -1, "Officer found!");
Kick(playerid);
}
return 1;
}