SA-MP Forums Archive
Help kick player - 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: Help kick player (/showthread.php?tid=551238)



Help kick player - Airblog - 17.12.2014

hello
i want kick every player that use . in his name

i put it under onplayerconnect
Код:
	
new playername[32];	
GetPlayerName(playerid, playername, sizeof(playername));
if(strfind( playername, ".", true) == -1)
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: You Cant Use . in your name");
Kick(playerid);
}
it doesnt work Plz Help


Re: Help kick player - Banana_Ghost - 17.12.2014

pawn Код:
forward kick(playerid);

public OnPlayerConnect(playerid)
{
    new playername[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
    if(strfind(playername,".")!=-1)
    {
        SendClientMessage(playerid,-1,"You Cannot Use A Name That Contains A . (Period) On This Server");
        SetTimerEx("kick",500,false,"i",playerid);
    }
    return 1;
}

public kick(playerid)
{
    Kick(playerid);
    return 1;
}