[Ajuda] Congelar Player
#1

Fiz um sistema de captcha para detecar ant-bot. Porйm ele funciona normal. O Player digita certo o textdraw some, porйm o player nao consegue andar, o mapa nem o dinheiro aparece.
Code:

pawn Код:
#include <a_samp>

new PlayerText:Captcha[40], TextArray[] = "1234567890QWERTYUIOPASDFGHJKLZXCVBNM";
public OnPlayerSpawn(playerid)
{
    for(new i = 0, cindex = 0; i < sizeof(Captcha); i++)
    {
        if(i == 0) Captcha[i] = CreatePlayerTextDraw(playerid, 269.0, 139.0, "Anti-bot captcha:");
        if(i == 1)
        {
            new cstring[24];
            format(cstring, sizeof(cstring), "%c%c%c%c%c", TextArray[random(sizeof(TextArray))], TextArray[random(sizeof(TextArray))], TextArray[random(sizeof(TextArray))], TextArray[random(sizeof(TextArray))], TextArray[random(sizeof(TextArray))]);
            Captcha[i] = CreatePlayerTextDraw(playerid, 422.0, 139.0, cstring);
            SetPVarString(playerid, "CaptchaCode", cstring);
        }
        if(i == 2) Captcha[i] = CreatePlayerTextDraw(playerid, 285.0, 174.0, "Please repeat:");
        if(i == 3) Captcha[i] = CreatePlayerTextDraw(playerid, 427.0, 178.0, "-----");
        if(i > 3)
        {
            new string[4];
            format(string, sizeof(string), "%c", TextArray[i - 4]);
            if(i >= 4) Captcha[i] = CreatePlayerTextDraw(playerid, 158.0 + (41.0 * cindex), 218.0, string);
            if(i == 14) cindex = 0, Captcha[i] = CreatePlayerTextDraw(playerid, 158.0 + (41.0 * cindex), 259.0, string);
            if(i > 14) Captcha[i] = CreatePlayerTextDraw(playerid, 158.0 + (41.0 * cindex), 259.0, string);
            if(i == 24) cindex = 0, Captcha[i] = CreatePlayerTextDraw(playerid, 178.0 + (41.0 * cindex), 300.0, string);
            if(i > 24) Captcha[i] = CreatePlayerTextDraw(playerid, 178.0 + (41.0 * cindex), 300.0, string);
            if(i == 33) cindex = 0, Captcha[i] = CreatePlayerTextDraw(playerid, 220.0 + (41.0 * cindex), 341.0, string);
            if(i > 33) Captcha[i] = CreatePlayerTextDraw(playerid, 220.0 + (41.0 * cindex), 341.0, string);
            PlayerTextDrawUseBox(playerid, Captcha[i], 1);
            PlayerTextDrawBoxColor(playerid, Captcha[i], 0x000000AA);
            PlayerTextDrawTextSize(playerid, Captcha[i], 29.0, 29.0);
            PlayerTextDrawSetSelectable(playerid, Captcha[i], 1);
            cindex++;
        }
        PlayerTextDrawLetterSize(playerid, Captcha[i], 0.63, 3.4);
        PlayerTextDrawAlignment(playerid, Captcha[i], 2);
        PlayerTextDrawSetOutline(playerid, Captcha[i], 1);
        PlayerTextDrawShow(playerid, Captcha[i]);
        SelectTextDraw(playerid, 0xFDE39DFF);
    }
    return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(!(_:clickedid ^ 0xFFFF)) return SelectTextDraw(playerid, 0xFDE39DFF);
    return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    for(new i = 4; i < sizeof(Captcha); i++)
    {
        if(playertextid == Captcha[i])
        {
            new step = GetPVarInt(playerid, "CaptchaStep"), sstring[96];
            GetPVarString(playerid, "CaptchaText", sstring, sizeof(sstring));
            switch(step)
            {
                case 0: format(sstring, sizeof(sstring), "%c", TextArray[i - 4]), strcat(sstring, "----"), SetPVarString(playerid, "CaptchaText", sstring);
                case 1: format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]), strdel(sstring, 1, 5), strcat(sstring, "---"), SetPVarString(playerid, "CaptchaText", sstring);
                case 2: format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]), strdel(sstring, 2, 5), strcat(sstring, "--"), SetPVarString(playerid, "CaptchaText", sstring);
                case 3: format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]), strdel(sstring, 3, 5), strcat(sstring, "-"), SetPVarString(playerid, "CaptchaText", sstring);
                case 4:
                {
                    strdel(sstring, 4, 5);
                    format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]);
                    PlayerTextDrawSetString(playerid, Captcha[3], sstring);
                    new cstring[24];
                    GetPVarString(playerid, "CaptchaCode", cstring, sizeof(cstring));
                    if(strcmp(cstring, sstring) != 0)
                    {
                        format(cstring, sizeof(cstring), "%c%c%c%c%c", TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)]);
                        PlayerTextDrawSetString(playerid, Captcha[1], cstring);
                        SetPVarString(playerid, "CaptchaCode", cstring);
                        PlayerTextDrawSetString(playerid, Captcha[3], "-----");
                        SendClientMessage(playerid, 0xFF0000FF, "Wrong anti-bot capthcha! Try again...");
                        DeletePVar(playerid, "CaptchaStep");
                        DeletePVar(playerid, "CaptchaText");
                        return 1;
                    }
                    else
                    {
                        for(new l = 0; l < sizeof(Captcha); l++) PlayerTextDrawHide(playerid, Captcha[l]);
                        DeletePVar(playerid, "CaptchaStep");
                        DeletePVar(playerid, "CaptchaCode");
                        DeletePVar(playerid, "CaptchaText");
                        SetPVarInt(playerid, "CaptchaPass", 1);
                        CancelSelectTextDraw(playerid);
                        SendClientMessage(playerid, 0x00FF00FF, "OK! You are not a bot. Welcome!");
                        return 1;
                    }
                }
            }
            SetPVarInt(playerid, "CaptchaStep", step + 1);
            PlayerTextDrawSetString(playerid, Captcha[3], sstring);
        }
    }
    return 1;
}
public OnPlayerText(playerid, text[])
{
    if(GetPVarInt(playerid, "CaptchaPass") != 1) return 0;
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(GetPVarInt(playerid, "CaptchaPass") != 1) return 0;
    return 1;
}
public OnPlayerRequestSpawn(playerid)
{
    if(GetPVarInt(playerid, "CaptchaPass") != 1) return 0;
    return 1;
}
Reply
#2

ninguem? '-'
Reply
#3

pawn Код:
#include <a_samp>

new PlayerText:Captcha[40], TextArray[] = "1234567890QWERTYUIOPASDFGHJKLZXCVBNM";
public OnPlayerSpawn(playerid)
{
    for(new i = 0, cindex = 0; i < sizeof(Captcha); i++)
    {
        if(i == 0) Captcha[i] = CreatePlayerTextDraw(playerid, 269.0, 139.0, "Anti-bot captcha:");
        if(i == 1)
        {
            new cstring[24];
            format(cstring, sizeof(cstring), "%c%c%c%c%c", TextArray[random(sizeof(TextArray))], TextArray[random(sizeof(TextArray))], TextArray[random(sizeof(TextArray))], TextArray[random(sizeof(TextArray))], TextArray[random(sizeof(TextArray))]);
            Captcha[i] = CreatePlayerTextDraw(playerid, 422.0, 139.0, cstring);
            SetPVarString(playerid, "CaptchaCode", cstring);
        }
        if(i == 2) Captcha[i] = CreatePlayerTextDraw(playerid, 285.0, 174.0, "Please repeat:");
        if(i == 3) Captcha[i] = CreatePlayerTextDraw(playerid, 427.0, 178.0, "-----");
        if(i > 3)
        {
            new string[4];
            format(string, sizeof(string), "%c", TextArray[i - 4]);
            if(i >= 4) Captcha[i] = CreatePlayerTextDraw(playerid, 158.0 + (41.0 * cindex), 218.0, string);
            if(i == 14) cindex = 0, Captcha[i] = CreatePlayerTextDraw(playerid, 158.0 + (41.0 * cindex), 259.0, string);
            if(i > 14) Captcha[i] = CreatePlayerTextDraw(playerid, 158.0 + (41.0 * cindex), 259.0, string);
            if(i == 24) cindex = 0, Captcha[i] = CreatePlayerTextDraw(playerid, 178.0 + (41.0 * cindex), 300.0, string);
            if(i > 24) Captcha[i] = CreatePlayerTextDraw(playerid, 178.0 + (41.0 * cindex), 300.0, string);
            if(i == 33) cindex = 0, Captcha[i] = CreatePlayerTextDraw(playerid, 220.0 + (41.0 * cindex), 341.0, string);
            if(i > 33) Captcha[i] = CreatePlayerTextDraw(playerid, 220.0 + (41.0 * cindex), 341.0, string);
            PlayerTextDrawUseBox(playerid, Captcha[i], 1);
            PlayerTextDrawBoxColor(playerid, Captcha[i], 0x000000AA);
            PlayerTextDrawTextSize(playerid, Captcha[i], 29.0, 29.0);
            PlayerTextDrawSetSelectable(playerid, Captcha[i], 1);
            cindex++;
        }
        PlayerTextDrawLetterSize(playerid, Captcha[i], 0.63, 3.4);
        PlayerTextDrawAlignment(playerid, Captcha[i], 2);
        PlayerTextDrawSetOutline(playerid, Captcha[i], 1);
        PlayerTextDrawShow(playerid, Captcha[i]);
        SelectTextDraw(playerid, 0xFDE39DFF);
    }
    return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(!(_:clickedid ^ 0xFFFF)) return SelectTextDraw(playerid, 0xFDE39DFF);
    return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    for(new i = 4; i < sizeof(Captcha); i++)
    {
        if(playertextid == Captcha[i])
        {
            new step = GetPVarInt(playerid, "CaptchaStep"), sstring[96];
            GetPVarString(playerid, "CaptchaText", sstring, sizeof(sstring));
            switch(step)
            {
                case 0: format(sstring, sizeof(sstring), "%c", TextArray[i - 4]), strcat(sstring, "----"), SetPVarString(playerid, "CaptchaText", sstring);
                case 1: format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]), strdel(sstring, 1, 5), strcat(sstring, "---"), SetPVarString(playerid, "CaptchaText", sstring);
                case 2: format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]), strdel(sstring, 2, 5), strcat(sstring, "--"), SetPVarString(playerid, "CaptchaText", sstring);
                case 3: format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]), strdel(sstring, 3, 5), strcat(sstring, "-"), SetPVarString(playerid, "CaptchaText", sstring);
                case 4:
                {
                    strdel(sstring, 4, 5);
                    format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]);
                    PlayerTextDrawSetString(playerid, Captcha[3], sstring);
                    new cstring[24];
                    GetPVarString(playerid, "CaptchaCode", cstring, sizeof(cstring));
                    if(strcmp(cstring, sstring) != 0)
                    {
                        format(cstring, sizeof(cstring), "%c%c%c%c%c", TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)]);
                        PlayerTextDrawSetString(playerid, Captcha[1], cstring);
                        SetPVarString(playerid, "CaptchaCode", cstring);
                        PlayerTextDrawSetString(playerid, Captcha[3], "-----");
                        SendClientMessage(playerid, 0xFF0000FF, "Wrong anti-bot capthcha! Try again...");
                        DeletePVar(playerid, "CaptchaStep");
                        DeletePVar(playerid, "CaptchaText");
                        return 1;
                    }
                    else
                    {
                        for(new l = 0; l < sizeof(Captcha); l++) PlayerTextDrawHide(playerid, Captcha[l]);
                        DeletePVar(playerid, "CaptchaStep");
                        DeletePVar(playerid, "CaptchaCode");
                        DeletePVar(playerid, "CaptchaText");
                        SetPVarInt(playerid, "CaptchaPass", 1);
                        CancelSelectTextDraw(playerid);
                        SendClientMessage(playerid, 0x00FF00FF, "OK! You are not a bot. Welcome!");
                        return 1;
                    }
                }
            }
            SetPVarInt(playerid, "CaptchaStep", step + 1);
            PlayerTextDrawSetString(playerid, Captcha[3], sstring);
            TogglePlayerControllable(playerid,1);
            SpawnPlayer(playerid);
        }
    }
    return 1;
}
public OnPlayerText(playerid, text[])
{
    if(GetPVarInt(playerid, "CaptchaPass") != 1) return 0;
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(GetPVarInt(playerid, "CaptchaPass") != 1) return 0;
    return 1;
}
public OnPlayerRequestSpawn(playerid)
{
    if(GetPVarInt(playerid, "CaptchaPass") != 1) return 0;
    return 1;
}
Reply
#4

Continua a mesma coisa.
Reply
#5

Quote:
Originally Posted by DevilAgain
Посмотреть сообщение
Continua a mesma coisa.
Tenta agora editei o post acima.
Reply
#6

Agora o player consegue usar os comandos, porйm, bugou o sistema..
Ex: Eu comeзo a digitar no textdraw, e ai nas 2° letras ja aparece uma em cima da outra e ai impossibilita que eu termine de digitar.
Reply
#7

up up..
Reply
#8

Este filterScript nгo foi vc quem o fez. Foi este aqui.

E parece que ele atualizou e removeu os Bugs.
Espero ter Ajudado
Reply
#9

Sim manow eu sei..
Mas pq ele nгo quer deixar o player se mover apуs digitar o codigo certo?
Reply
#10

Quote:
Originally Posted by Schocc
Посмотреть сообщение
Este filterScript nгo foi vc quem o fez. Foi este aqui.

E parece que ele atualizou e removeu os Bugs.
Espero ter Ajudado
FS ATUALIZADO REMOVIDO OS BUGS

Download: pastebin

@EDIT: Se vc quiser congelar o Player e Descongelar use isso
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)