Connect bot checker(random numbers)
#9

So I tested with printf.
It printed all,if i write wrong it will be nothing.
Код:
#include a_samp
new PlayerKickTimer[MAX_PLAYERS];
new PlayerString[MAX_PLAYERS];


public OnPlayerConnect(playerid)
{
      PlayerKickTimer[playerid] = SetTimerEx("KickEx", 300*60, false, "i", playerid);
      randomString(PlayerString[playerid], 10);
      new string[64];
      format(string, sizeof string, "Type the following string: %s", PlayerString[playerid]);
      ShowPlayerDialog(playerid, 6973, DIALOG_STYLE_INPUT, "String", string, "ok", "ok");

      return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
      if(dialogid == 6973 && response)
      {
           printf("asd0");
           if(strcmp(inputtext, PlayerString[playerid], true) != -1)
           {
                // correct
                printf("asd1");
           }
           else Kick(playerid);
           printf("asd2");
      }
      printf("asd3");
      return 1;
}

stock randomString(strDest[], strLen = 10)
{
	while(strLen--)
		strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0');
}
Print(i wrote wrong that random code):
Код:
[20:51:32] asd0
[20:51:32] asd1
[20:51:32] asd2
[20:51:32] asd3
What's wrong?
Reply


Messages In This Thread
Connect bot checker(random numbers) - by tristan137 - 21.02.2015, 20:06
Re: Connect bot checker(random numbers) - by AndySedeyn - 21.02.2015, 20:15
Re: Connect bot checker(random numbers) - by Puppy - 21.02.2015, 20:23
Re: Connect bot checker(random numbers) - by arlindi - 21.02.2015, 21:07
Re: Connect bot checker(random numbers) - by tristan137 - 21.02.2015, 21:17
Re: Connect bot checker(random numbers) - by JaydenJason - 21.02.2015, 22:14
Re: Connect bot checker(random numbers) - by tristan137 - 22.02.2015, 18:03
Re: Connect bot checker(random numbers) - by AndySedeyn - 22.02.2015, 18:07
Re: Connect bot checker(random numbers) - by tristan137 - 22.02.2015, 18:19

Forum Jump:


Users browsing this thread: 8 Guest(s)