Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- SA-MP Captcha by BaRRyS3R.mp3
- Release Version: 1.0
- Date: 31.03.2010
- */
- #include <a_samp>
- new CaptchSymb[36][] = {"1","2","3","4","5","6","7","8","9","0","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
- new Pcaptcha[MAX_PLAYERS][128];
- forward CreateCaptcha(playerid);
- public OnFilterScriptInit()
- {
- print(" SA-MP Capcha by BaRRyS3R.mp3");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- CreateCaptcha(playerid);
- return 1;
- }
- public CreateCaptcha(playerid)
- {
- new Symb1 = random(sizeof(CaptchSymb)),
- Symb2 = random(sizeof(CaptchSymb)),
- Symb3 = random(sizeof(CaptchSymb)),
- Symb4 = random(sizeof(CaptchSymb)),
- Symb5 = random(sizeof(CaptchSymb));
- new string[64];
- format(Pcaptcha[playerid], 64,"%s%s%s%s%s", CaptchSymb[Symb1],CaptchSymb[Symb2],CaptchSymb[Symb3],CaptchSymb[Symb4],CaptchSymb[Symb5]);
- format(string, 128, "Type the characters:\n%s", Pcaptcha[playerid]);
- ShowPlayerDialog(playerid, 32425, 1, "SA-MP Captcha", string, "OK", "Cancel");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 32425)
- {
- if(!response)
- {
- SendClientMessage(playerid, 0xFFFFFF, "Pressed cancel. [Kick]");
- Kick(playerid);
- }
- else
- {
- if (!strcmp(inputtext, " "))
- {
- SendClientMessage(playerid, 0xFFFFFF, "Captcha typed incorrectly.");
- Kick(playerid);
- }
- if(!strcmp(inputtext, Pcaptcha[playerid]))
- {
- SendClientMessage(playerid, 0xFFFFFF, "Captcha typed correctly.");
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFF, "Captcha typed incorrectly.");
- Kick(playerid);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement