One Word Admin Names
#2

Quote:
Originally Posted by Melon
Посмотреть сообщение
Hello, my script doesn't allow the use of one word names such as 'Dan' or 'Jay'. If you could script something that allows these names, please could you do that it would help me greatly.

The line: if(strcmp(playername, "Dan", true) == 0) is listed but when I try to log in, it doesn't kick me, on entry of password it does not spawn me ingame.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[256];
    if(IsPlayerNPC(playerid))
    {
        printf("OnDialogResponse: BotKick: %d", playerid);
        Kick(playerid);
        return 1;
    }
    if(dialogid == 1) //LOGIN
    {
        if(gPlayerLogged[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
            return 1;
        }
        if(response)
        {
            if(!strlen(inputtext))
            {
                DisplayDialogForPlayer(playerid, 1); //login
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must enter a password.");
                return 1;
            }
            if(strlen(inputtext) >= 50)
            {
                DisplayDialogForPlayer(playerid, 1); //login
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: Password is too long.");
                return 0;
            }
            new tmppass[64];
            new playername[MAX_PLAYER_NAME];
            strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
            GetPlayerName(playerid, playername, sizeof(playername));
            if(strlen(playername) == 3)
            {
                if(strcmp(playername, "Dan", true) == 0)
            {
                    return 0;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_YELLOW, "Sorry, that name is too short, please change it.");
                    SendClientMessage(playerid, COLOR_YELLOW, "Please use the Firstname_Lastname format.");
                    SendClientMessage(playerid, COLOR_YELLOW, "Name Examples: Jhonny_John, Dan_Wilson, Sarah_Raven");
                    Kick(playerid);
                    return 1;
                }
            }
            Encrypt(tmppass);
            OnPlayerLogin(playerid,tmppass);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You chose to quit from the server (/q).");
            Kick(playerid);
        }
    }
I need this to work for only admins.
What are the errors that coming can you show please?
Reply


Messages In This Thread
One Word Admin Names - by Melon - 31.07.2012, 22:51
Re: One Word Admin Names - by Majed - 31.07.2012, 23:42
Re: One Word Admin Names - by Melon - 31.07.2012, 23:46
Re: One Word Admin Names - by gnoomen2 - 01.08.2012, 00:24
Re: One Word Admin Names - by Melon - 01.08.2012, 00:56
Re: One Word Admin Names - by gnoomen2 - 01.08.2012, 18:10
Re: One Word Admin Names - by Roko_foko - 01.08.2012, 18:20
Re: One Word Admin Names - by Melon - 01.08.2012, 21:29

Forum Jump:


Users browsing this thread: 4 Guest(s)