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

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

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

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

No problem, glad I could help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)