SA-MP Forums Archive
Name Checker dosn't work correctly for rp names.. (Doesn't send message just kick player out!) - 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: Name Checker dosn't work correctly for rp names.. (Doesn't send message just kick player out!) (/showthread.php?tid=420874)



Name Checker dosn't work correctly for rp names.. (Doesn't send message just kick player out!) - Scrillex - 07.03.2013

So basically it shows only Server has close connection it doesn't send message about that he needs to change his name to Roleplay name!

pawn Код:
new name[MAX_PLAYER_NAME+1], str[24+MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));
    // Has numbers
    if(strfind(name, "0", true) != -1 || strfind(name, "1", true) != -1 || strfind(name, "2", true) != -1 || strfind(name, "3", true) != -1 || strfind(name, "4", true) != -1 || strfind(name, "5", true) != -1
    || strfind(name, "6", true) != -1 || strfind(name, "7", true) != -1 || strfind(name, "8", true) != -1 || strfind(name, "9", true) != -1 || strfind(name, "[", true) != -1 || strfind(name, "]", true) != -1)
    {
        SendClientMessage(playerid, red, "SERVER: {FFFFFF}This is a RP Server, please reconnect using Firstname_Lastname format.");
        SendClientMessage(playerid, red, "SERVER: {FFFFFF}Also, please remove the numbers and/or tags in your name.");
        GetPlayerName(playerid, name, sizeof(name));
        format(str, sizeof(str), "%s has been kicked from the server for having a Non-RP name.", name);
        SendClientMessageToAll(0xC4C4C4FF, str);
        Kick(playerid);
    }
    // No Underscore
    if(strfind( name, "_", true) == -1)
    {
        SendClientMessage(playerid, red, "SERVER: {FFFFFF}This is a RP Server, please reconnect using Firstname_Lastname format.");
        format(str, sizeof(str), "%s has been kicked from the server for having a Non-RP name.", name);
        SendClientMessageToAll(0xC4C4C4FF, str);
        Kick(playerid);
    }



Re: Name Checker dosn't work correctly for rp names.. (Doesn't send message just kick player out!) - Mystique - 07.03.2013

Due to the new sa-mp version a message will not be shown if you use Kick(playerid);.
You need to read this.
https://sampwiki.blast.hk/wiki/Kick


Re: Name Checker dosn't work correctly for rp names.. (Doesn't send message just kick player out!) - Scrillex - 07.03.2013

uhh didn't know that.. thanks for that +rep from me


Re: Name Checker dosn't work correctly for rp names.. (Doesn't send message just kick player out!) - Mystique - 07.03.2013

No problem, glad I could help.