Admin verification
#1

I wanted to script admin verification code. That whenever a player connects that is an admin it will give him a window and he will have to enter the code that follows premade pattern. And if he fails 2 times he will get IP Ban. +rep to the guy who can do it.
Reply
#2

is this premade pattern something the person chooses or something the server chooses like rcon password
Reply
#3

Premade pattern.

Like there is pattern 77ksmMMMjs. And he has to type it exacly. If he misses is 2 times it IP bans him.
Reply
#4

PHP код:
#define Admin_Code "Yellow"
new bool:ALogged[MAX_PLAYERS] = false;

public 
OnPlayerConnect(playerid)
{
    
ShowPlayerDialog(playerid424DIALOG_STYLE_INTPUT"Administrator Login""Please input the administration's password in order to proceed.""Login""Disconnect");
    return 
1;
}

public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 424)
    {
        if(!
response) return SendClientMessage(playerid, -1"You have failed to input your password and therefore, you have been kicked.");
        if(!
strcmp(Admin_Codeinputtexttrue)) return ALogged[playerid] = true;
    }
    return 
1;
}

public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
ALogged[playerid]) return SendClientMessage(playerid, -1"You must be logged in to use any command."), 0;
    return 
1;

Reply
#5

This is ok. But I have a little problem. Uhmm I have the register system. ANd it interfeers with admin pw.
I want it to make it like that:
1. Player normaly logins with his password
2. IF he is logged in it checkes if he is Admin or not.
3. IF yes put this admin pw.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)