Saveing players postion after logging off and RP name help
#5

Alright here's the code:

Add this anywhere you like.
pawn Код:
stock IsValidName(playerid)
{
    if (IsPlayerConnected(playerid))
    {
        new player[24];
        GetPlayerName(playerid,player,24);
        for(new n = 0; n < strlen(player); n++)
        {
            if (player[n] == '_' && player[n+1] >= 'A' && player[n+1] <= 'Z') return 1;
            if (player[n] == ']' || player[n] == '[') return 0;
        }
    }
    return 0;
}
Then add this in the public function "OnPlayerConnect"

pawn Код:
if(!IsValidName(playerid))
    {
        SendClientMessage(playerid,COLOR_RED,"You have been kicked, reason: Invalid RolePlay Name.");
        SendClientMessage(playerid,COLOR_WHITE,"HINT: Acceptable Roleplay Name (E.G: Ethan_Crowley)");
        Kick(playerid);
    }
You may change the words, and the colors as you like.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)