Admin verification - 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: Admin verification (
/showthread.php?tid=466658)
Admin verification -
xdarren - 28.09.2013
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.
Re: Admin verification -
NinjahZ - 28.09.2013
is this premade pattern something the person chooses or something the server chooses like rcon password
Re: Admin verification -
xdarren - 28.09.2013
Premade pattern.
Like there is pattern 77ksmMMMjs. And he has to type it exacly. If he misses is 2 times it IP bans him.
Re: Admin verification -
Accord - 28.09.2013
PHP код:
#define Admin_Code "Yellow"
new bool:ALogged[MAX_PLAYERS] = false;
public OnPlayerConnect(playerid)
{
ShowPlayerDialog(playerid, 424, DIALOG_STYLE_INTPUT, "Administrator Login", "Please input the administration's password in order to proceed.", "Login", "Disconnect");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
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_Code, inputtext, true)) return ALogged[playerid] = true;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!ALogged[playerid]) return SendClientMessage(playerid, -1, "You must be logged in to use any command."), 0;
return 1;
}
Re: Admin verification -
xdarren - 28.09.2013
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.