SA-MP Forums Archive
Anti-Bot System Bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Anti-Bot System Bug (/showthread.php?tid=238924)



Anti-Bot System Bug - Garciano44 - 12.03.2011

Код:
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.


Re: Anti-Bot System Bug - Garciano44 - 12.03.2011

Help me??