stock randomString(strDest[], strLen = 10)
{
while(strLen--)
strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0');
}
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;
}
pawn Код:
And for the timer: pawn Код:
|
Can someone make me Puppys's code to a complete filterscript?
|
#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) { if(strcmp(inputtext, PlayerString[playerid], true) != -1) { // correct } else Kick(playerid); } return 1; } stock randomString(strDest[], strLen = 10) { while(strLen--) strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0'); }
#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'); }
[20:51:32] asd0 [20:51:32] asd1 [20:51:32] asd2 [20:51:32] asd3