how to kick player if his name had [admin] but it isn't admin
#1

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

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

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;
}
Reply
#4

Use strfind.
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)