Connect bot checker(random numbers)
#3

pawn Код:
stock randomString(strDest[], strLen = 10)
{
    while(strLen--)
        strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0');
}
Credits to Ryder~.

And for the timer:
pawn Код:
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, DIALOG_VERIFY, DIALOG_STYLE_INPUTTEXT, "String", string, "ok", "ok");

      return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
      if(dialogid == DIALOG_VERIFY && response)
      {
           if(strcmp(inputtext, PlayerString[playerid], true) != -1)
           {
                // correct
           }
           else KickEx(playerid);
      }
      return 1;
}
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)