16.02.2018, 01:50
PHP код:
#define DIALOG_SECURITY 14444
#define SECURITY_PASSWORD "asdjkl"
new wrongtimes[MAX_PLAYERS] = 0;
PHP код:
if(strfind("YourName", GetName(playerid), true) != -1)
{
ShowPlayerDialog(playerid,DIALOG_SECURITY,DIALOG_STYLE_PASSWORD,"Security Password","Enter the security password if is that you are real","Enter","Quit");
}
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_SECURITY:
{
if(response)
{
if(strcmp(SECURITY_PASSWORD, inputtext, false, 10) == 0)
{
SendClientMessage(playerid,-1,"Success Logged in");
}
else
{
wrongtimes[playerid] ++;
ShowPlayerDialog(playerid,DIALOG_SECURITY,DIALOG_STYLE_PASSWORD,"Security Password","{FF0000}You have enters wrong security password\n{FFFFFF}Enter the security password if is that you are real","Enter","Quit");
if(wrongtimes[playerid] >= 3)
{
SendClientMessage(playerid,-1,"Message Here");
// when they wrong enter security password 3times
}
}
}
else
{
SendClientMessage(playerid,-1,"Message Here");
// when they didn't enter security password
}
}
}
return 1;
}
PHP код:
stock GetName(playerid)
{
new szName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szName, sizeof(szName));
return szName;
}

