SA-MP Forums Archive
how to kick player if his name had [admin] but it isn't admin - 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 to kick player if his name had [admin] but it isn't admin (/showthread.php?tid=449427)



how to kick player if his name had [admin] but it isn't admin - Chrisli520 - 08.07.2013

can i do that?when a player enter my server, and his name is like [admin] xxx but he is not admin, i want the systen kick him for his bad name


Re: how to kick player if his name had [admin] but it isn't admin - Isolated - 08.07.2013

Try using strcmp to compare the name. If you need help, just let me know.


Re: how to kick player if his name had [admin] but it isn't admin - CAR - 08.07.2013

pawn Код:
public OnPlayerConnect(playerid)
{
    pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    if(!strcmp(pName, "[admin]", false, strlen("[admin]"))) Kick(playerid);
    return 1;
}



Re: how to kick player if his name had [admin] but it isn't admin - tyler12 - 08.07.2013

Use strfind.


Re: how to kick player if his name had [admin] but it isn't admin - GiamPy. - 08.07.2013

pawn Код:
if(strfind(playerName, "[admin]", true) && !IsPlayerAdmin(playerid))
    Kick(playerid);
Easier.