Код:
public OnPlayerConnect(playerid)
{
new PlayerName[MAX_PLAYERS];
new TempConnect[150];
SetPVarInt(playerid,"number1",random(100));
SetPVarInt(playerid,"number2",random(100));
format(TempConnect,sizeof TempConnect,"Welcome %s,\nYou must answer questions.\n \n %d + %d = ?",PlayerName,GetPVarInt(playerid,"insantestia"),GetPVarInt(playerid,"insantestia"));
ShowPlayerDialog(playerid,3300,DIALOG_STYLE_INPUT,"Anti-Bot",TempConnect,"OK","EXIT");
return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 3300)
{
if(GetPVarInt(playerid,"number1") + GetPVarInt(playerid,"number2") == strval(inputtext))
{
new file[256], PlayerName[MAX_PLAYERS];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(file,sizeof(file),"hesaplar/%s.ini",PlayerName);
if(!fexist(file))
{
ShowPlayerDialog(playerid, 3344, DIALOG_STYLE_INPUT, "Register", "Pass:", "Register", "Exit");
}
if(fexist(file))
{
ShowPlayerDialog(playerid, 3355, DIALOG_STYLE_INPUT, "Login", "Pass", "Login", "Exit");
}
else
{
new TempConnect[150];
SetPVarInt(playerid,"number1",random(100));
SetPVarInt(playerid,"number2",random(100));
format(TempConnect,sizeof TempConnect,"Welcome %s,\nYou must answer questions.\n \n %d + %d = ?",PlayerName,GetPVarInt(playerid,"number1"),GetPVarInt(playerid,"number2"));
ShowPlayerDialog(playerid,3300,DIALOG_STYLE_INPUT,"Anti-Bot",TempConnect,"OK","EXIT");
}
}
}
return 1;
}
This system does not work. Help me please.