SA-MP Forums Archive
I NEED SOME HELP QUICKLY! PLEASE! :( - 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: I NEED SOME HELP QUICKLY! PLEASE! :( (/showthread.php?tid=340180)



I NEED SOME HELP QUICKLY! PLEASE! :( - VanillaRain - 06.05.2012

Ok the thing i want to do is a filterscript that check 3 PlayerName (not ID, NAME!) that are the Admins and just connected a DIALOG_STYLE_MSGBOX come out and say to enter the server password.. if the password is correct he can enter the server, else he will be kicked out! Is this a possible thing to do or is impossible?

Thanks to everyone who help me!




Re: I NEED SOME HELP QUICKLY! PLEASE! :( - Jikesh - 06.05.2012

It is possible to make a FS which checks 3 different player nicks and shows up a dialog box for them to enter a password. If the entered password does not match your defined password (in the FS) then they get kicked.


Re: I NEED SOME HELP QUICKLY! PLEASE! :( - VanillaRain - 06.05.2012

Quote:
Originally Posted by jikesh_jus
View Post
It is possible to make a FS which checks 3 different player nicks and shows up a dialog box for them to enter a password. If the entered password does not match your defined password (in the FS) then they get kicked.
exact this i what i would like! can you please help with coding it? **


Re: I NEED SOME HELP QUICKLY! PLEASE! :( - VanillaRain - 06.05.2012

UP!!


Re: I NEED SOME HELP QUICKLY! PLEASE! :( - Shadow_ - 06.05.2012

pawn Code:
public OnPlayerConnect(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    if(strcmp(pName, "Test", true) || strcmp(pName, "Test1", true) || strcmp(pName, "test2", true))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Password", "Please enter the server password", "Enter", "Quit");
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(response)
        {
            new password = strval(inputtext);
            if(password == strval("Testing"))
            {
                // GivePlayerAdmin
            }
            else return Kick(playerid);
        }
        else return Kick(playerid);
    }
    return 1;
}
Not tested it, not even sure if it will work. but i imagine it will be something very similar to that.


Re: I NEED SOME HELP QUICKLY! PLEASE! :( - VanillaRain - 06.05.2012

Quote:
Originally Posted by Shadow_
View Post
pawn Code:
public OnPlayerConnect(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    if(strcmp(pName, "Test", true) || strcmp(pName, "Test1", true) || strcmp(pName, "test2", true))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Password", "Please enter the server password", "Enter", "Quit");
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(response)
        {
            new password = strval(inputtext);
            if(password == strval("Testing"))
            {
                // GivePlayerAdmin
            }
            else return Kick(playerid);
        }
        else return Kick(playerid);
    }
    return 1;
}
Not tested it, not even sure if it will work. but i imagine it will be something very similar to that.
I Will test it after lunch and tell here if it works! Thanks a lot at the moment bro!