Posts: 871
Threads: 114
Joined: May 2014
Quote:
Originally Posted by Puppy
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; }
|
This is good Ideaa
Must help you