28.09.2013, 22:28
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;
}