[FilterScript] Via Fбcil By. Paulo_TerroR
#1

Ae pessoal venho lhes trazer uma novidade aki no forum! Pedбgio Via Fбcil.
* Comentбrio

Esse sistema de pedбgio Via Fбcil й um sistema que o jogador pode comprar plano para que nгo precise pagar e nem parar no pedбgio, caso ele nгo tenha o plano e fica congelado por 3s e pague mais caro.

*Comandos

/viafacil - mostra um Dialog com 5 opзoes para compra do plano sгo eles:

Plano 1 - 10 pass R$ 1000,00
Plano 2 - 20 pass R$ 1900,00
Plano 3 - 30 pass R$ 2800,00
Plano 4 - 50 pass R$ 5000,00
Plano 5 - 100 pass R$ 9000,00


* Como adicionar mais Pedбgios ?

Altere essa a var 'Cancela' conforme o numero de cancelas, assim:
pawn Код:
new Cancela[MAX_PLAYERS][3];//3 Cancelas
No OnPlayerConnect faзa o seguinte.
pawn Код:
//Objetos do pedagio...

//Cancela
Cancela[playerid][2] = CreatePlayerObject(playerid, 968, X, Y, Z,   rX, rY, rZ);//Crie o objeto dessa maneira
Agora vб na public CheckViaFacil e adicione o seu pedagio. Ex:
pawn Код:
if(IsPlayerInRangeOfPoint(i, 5.0, X, Y, Z)) { //Cancela fechada
    if(ViaFacil[i] && !Pedagio[i]) {
        Pedagio[i] = true; //Evitar Flood
        if(GetPlayerState(i) == PLAYER_STATE_DRIVER) {
            SendClientMessage(i, 0xFFFFFFFF, "Via Fбcil: Vocк possui o plano Via Fбcil e nгo precisa parar! Boa Viagem.");
            ViaFacil[i] --;
        }
        MovePlayerObject(i, Cancela[i][2], X, Y, Z+0.0001, 0.0001, rX, rY, rZ);//Cancela aberta
    }
    if(!ViaFacil[i] && !Pedagio[i]) {
        Pedagio[i] = true; //Evitar Flood
        if(GetPlayerState(i) == PLAYER_STATE_DRIVER) {
            SendClientMessage(i, 0xFFFFFFFF, "Via Fбcil: Vocк nгo possui o plano Via Fбcil e precisa parar!");
            TogglePlayerControllable(i, false);
            sleep2(3);
            TogglePlayerControllable(i, true);
            GivePlayerMoney(i, -500);
        }
        MovePlayerObject(i, Cancela[i][2], X, Y, Z+0.0001, 0.0001, rX, rY, rZ);//Cancela aberta
    }
}
Nessa parte, faзa o seguinte!
pawn Код:
else {
    if(Pedagio[i]) {
        Pedagio[i] = false;
        MovePlayerObject(i, Cancela[i][0], 56.05, -1528.62, 4.67, 0.0001, 0.0000, 270.0000, 262.0000);
        MovePlayerObject(i, Cancela[i][1], 56.05, -1535.82, 4.71, 0.0001, 0.0000, 90.0000, 262.0000);
        MovePlayerObject(i, Cancela[i][2], X, Y, Z, 0.0001, rX, rY, rZ);//Cancela fechada
    }
}
Pronto pedagio novo criado!

* Video

http://*********/yMhBpWu3G14

* Creditos

Paulo_TerroR - Criador.
Equipe SA-MP(Passado\Presente\Futuro) - SAMP.


* Download

PasteBin
Sites******


* Observaзгo

Foi retirado um Bug relatado por Coringa_Smith157, e tambйm foi adicionado movimento dinвmico б cancela!
Qualquer BUG me contatar por MP ou pelo Post mesmo! Ficarei agradecido.
Sugestхes sгo bem-vindas!
Bom jogo!
Reply
#2

Gostei Do Pedagio, Bem Criativo, Igual a Realidade
Reply
#3

Zika memo , paulor й fodгo

=D

Dei 1 rep ai
Reply
#4

muito bom cara vlw por compartilhar fico zica!
Reply
#5

Bom sistema paulor,

Nгo sei se й proibido ou nгo, eu te recomendo a tirar outras prints, sem o s0rvete, para evitar possнveis problemas.
Reply
#6

Quote:
Originally Posted by [Red]Maninho
Посмотреть сообщение
Gostei Do Pedagio, Bem Criativo, Igual a Realidade
Quote:
Originally Posted by Felipe_Freeze
Посмотреть сообщение
Zika memo , paulor й fodгo

=D

Dei 1 rep ai
Vlw. eu quando tive a ideia pensei q ir ser muito foda pois eh bem rpg.

Quote:
Originally Posted by -iLusioN-
Посмотреть сообщение
Lol manolo fico rox bela ideia >_<'
vlw.

Quote:
Originally Posted by Juninho_Oakley
Посмотреть сообщение
muito bom cara vlw por compartilhar fico zica!
estava pensando em compartilhar algo dai pensei em criar este sistema vlw msm!

Quote:
Originally Posted by Hard`
Посмотреть сообщение
Bom sistema paulor,

Nгo sei se й proibido ou nгo, eu te recomendo a tirar outras prints, sem o s0rvete, para evitar possнveis problemas.
kkkk sabia q alguem ia comentar, eu como adm do meu sv uso o sorvete pois tem muitas funcionalidades q nгo da pra fazer no cod. mas entao vou tirar umas sem ele. vlw
Reply
#7

Quote:
Originally Posted by paulor
Посмотреть сообщение
kkkk sabia q alguem ia comentar, eu como adm do meu sv uso o sorvete pois tem muitas funcionalidades q nгo da pra fazer no cod. mas entao vou tirar umas sem ele. vlw
Eu falei, por que eu jб vi(eu acho) que um membro, foi banido por isso.

Se nгo fosse te pedir muito, me passe esses seus mods?(Fonte, Aqueles baguio das armas, e a fonte emcima do colete(meu nome e Paulo tambйm. )

Reply
#8

Quote:
Originally Posted by Hard`
Посмотреть сообщение
Eu falei, por que eu jб vi(eu acho) que um membro, foi banido por isso.

Se nгo fosse te pedir muito, me passe esses seus mods?(Fonte, Aqueles baguio das armas, e a fonte emcima do colete(meu nome e Paulo tambйm. )

kkkk й msm. blz chara mando por mp.
Reply
#9

Bom Paulo Repare Se Voce Fez Uma FilterScript Nao Se Deve Usar OnGameModeInit Se Usa OnFilterScriptIni

Entao Seu Code Ficaria Dessa Maneira
pawn Код:
#include <a_samp>

    enum Info
    {
            ViaFacil
    };

    new Jogador[MAX_PLAYERS][Info];
    new Pedagio[MAX_PLAYERS];
    new Cancela1, Cancela2;


    public OnFilterScriptInit()
    {
        print("\n.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ");
        print("                                        ");
        print("·ґЇ`·*» Via Fбcil By. Paulo «*·ґЇ`·     ");
        print("                                        ");
        print("·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_\n");
       
        CreateObject(8168, 55.97, -1532.31, 6.07,   0.00, 0.00, 8.00);
        CreateObject(966, 56.05, -1528.62, 3.93,   0.00, 0.00, 262.00);
        Cancela1 = CreateObject(968, 56.05, -1528.62, 4.67,   0.00, 270.00, 262.00);
        CreateObject(966, 56.05, -1535.86, 3.93,   0.00, 0.00, 82.00);
        Cancela2 = CreateObject(968, 56.05, -1535.82, 4.71,   0.00, 90.00, 262.00);

            SetTimer("CheckViaFacil", 500, true);
            return 1;
    }

    public OnFilterScriptExit()
    {
            return 1;
    }


    main()
    {
        print("\n.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ");
        print("                                        ");
        print("·ґЇ`·*» Via Fбcil By. Paulo «*·ґЇ`·     ");
        print("                                        ");
        print("·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_\n");
    }

    public OnPlayerConnect(playerid)
    {
            Pedagio[playerid] = 0;
            return 1;
    }

    public OnPlayerCommandText(playerid, cmdtext[])
    {
            if (strcmp(cmdtext, "/viafacil", true) == 0)
            {
                    new string[] = "Plano 1 - 10 Pass       R$ 1.000,00\nPlano 2 - 20 Pass  R$ 1.900,00\nPlano 3 - 30 Pass  R$ 2.800,00\nPlano 4 - 50 Pass  R$ 5.000,00\nPlano 5 - 100 Pass R$ 9.000,00";
                    ShowPlayerDialog(playerid, 5416, DIALOG_STYLE_LIST, "Plano - Via Fбcil", string, "Comprar", "Fechar");
                    return 1;
            }
            return 0;
    }

    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
            if(dialogid == 5416)
            {
                if(response)
                {
                    if(listitem == 0)
                    {
                        SendClientMessage(playerid, 0xFFFFFFFF, "Vocк comprou 10 Pass Via Fбcil!");
                        Jogador[playerid][ViaFacil] += 10;
                        GivePlayerMoney(playerid, -1000);
                        return 1;
                            }
                    if(listitem == 1)
                    {
                        SendClientMessage(playerid, 0xFFFFFFFF, "Vocк comprou 20 Pass Via Fбcil!");
                        Jogador[playerid][ViaFacil] += 20;
                        GivePlayerMoney(playerid, -1900);
                        return 1;
                            }
                    if(listitem == 2)
                    {
                        SendClientMessage(playerid, 0xFFFFFFFF, "Vocк comprou 30 Pass Via Fбcil!");
                        Jogador[playerid][ViaFacil] += 30;
                        GivePlayerMoney(playerid, -2800);
                        return 1;
                            }
                    if(listitem == 3)
                    {
                        SendClientMessage(playerid, 0xFFFFFFFF, "Vocк comprou 50 Pass Via Fбcil!");
                        Jogador[playerid][ViaFacil] += 50;
                        GivePlayerMoney(playerid, -5000);
                        return 1;
                            }
                    if(listitem == 4)
                    {
                        SendClientMessage(playerid, 0xFFFFFFFF, "Vocк comprou 100 Pass Via Fбcil!");
                        Jogador[playerid][ViaFacil] += 100;
                        GivePlayerMoney(playerid, -9000);
                        return 1;
                            }
                }
            }
            return 1;
    }

    forward CheckViaFacil();
    public CheckViaFacil()
    {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                    if(IsPlayerConnected(i))
                    {
                        if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
                        {
                            if(IsPlayerInRangeOfPoint(i, 5, 56.05, -1528.62, 4.67))
                            {
                                if(Jogador[i][ViaFacil] > 0 && Pedagio[i] == 0)
                                {
                                    SendClientMessage(i, 0xFFFFFFFF, "Via Fбcil: Vocк possui o plano Via Fбcil e nгo precisa parar! Boa Viagem.");
                                    Pedagio[i] = 1; //Evitar Flood
                                    Jogador[i][ViaFacil] --;
                                    SetObjectRot(Cancela1, 0.0000, 0.0000, 262.0000);
                                            }
                                            else if(Jogador[i][ViaFacil] == 0 && Pedagio[i] == 0)
                                            {
                                                    SendClientMessage(i, 0xFFFFFFFF, "Via Fбcil: Vocк nгo possui o plano Via Fбcil e precisa parar!");
                                    Pedagio[i] = 1; //Evitar Flood
                                    TogglePlayerControllable(i, false);
                                            SetTimerEx("Descongelar", 3000, false, "i", i);
                                    GivePlayerMoney(i, -500);
                                    SetObjectRot(Cancela1, 0.0000, 0.0000, 262.0000);
                                            }
                                    }
                                    else if(IsPlayerInRangeOfPoint(i, 5, 56.05, -1535.82, 4.71))
                            {
                                if(Jogador[i][ViaFacil] > 0 && Pedagio[i] < 1)
                                {
                                    SendClientMessage(i, 0xFFFFFFFF, "Via Fбcil: Vocк possui o plano Via Fбcil e nгo precisa parar! Boa Viagem.");
                                    Pedagio[i] = 1; //Evitar Flood
                                    Jogador[i][ViaFacil] --;
                                    SetObjectRot(Cancela2, 0.0000, 0.0000, 262.0000);
                                            }
                                            else if(Jogador[i][ViaFacil] == 0 && Pedagio[i] < 1)
                                            {
                                                    SendClientMessage(i, 0xFFFFFFFF, "Via Fбcil: Vocк nгo possui o plano Via Fбcil e precisa parar!");
                                    Pedagio[i] = 1; //Evitar Flood
                                    TogglePlayerControllable(i, false);
                                            SetTimerEx("Descongelar", 3000, false, "i", i);
                                    GivePlayerMoney(i, -500);
                                    SetObjectRot(Cancela2, 0.0000, 0.0000, 262.0000);
                                            }
                                    }
                                    else
                                    {
                        Pedagio[i] = 0;
                        SetObjectRot(Cancela1, 0.0000, 270.0000, 262.0000);
                        SetObjectRot(Cancela2, 0.0000, 90.0000, 262.0000);
                                    }
                        }
                    }
            }
            return 1;
    }

    forward Descongelar(i);
    public Descongelar(i)
    {
        TogglePlayerControllable(i, true);
            return 1;
    }
Arrume PF
Reply
#10

Quote:
Originally Posted by Don_Speed
Посмотреть сообщение
Bom Paulo Repare Se Voce Fez Uma FilterScript Nao Se Deve Usar OnGameModeInit Se Usa OnFilterScriptIni

Entao Seu Code Ficaria Dessa Maneira
pawn Код:
#include <a_samp>

    enum Info
    {
            ViaFacil
    };

    new Jogador[MAX_PLAYERS][Info];
    new Pedagio[MAX_PLAYERS];
    new Cancela1, Cancela2;


    public OnFilterScriptInit()
    {
        print("\n.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ");
        print("                                        ");
        print("·ґЇ`·*» Via Fбcil By. Paulo «*·ґЇ`·     ");
        print("                                        ");
        print("·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_\n");
       
        CreateObject(8168, 55.97, -1532.31, 6.07,   0.00, 0.00, 8.00);
        CreateObject(966, 56.05, -1528.62, 3.93,   0.00, 0.00, 262.00);
        Cancela1 = CreateObject(968, 56.05, -1528.62, 4.67,   0.00, 270.00, 262.00);
        CreateObject(966, 56.05, -1535.86, 3.93,   0.00, 0.00, 82.00);
        Cancela2 = CreateObject(968, 56.05, -1535.82, 4.71,   0.00, 90.00, 262.00);

            SetTimer("CheckViaFacil", 500, true);
            return 1;
    }

    public OnFilterScriptExit()
    {
            return 1;
    }


    main()
    {
        print("\n.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ");
        print("                                        ");
        print("·ґЇ`·*» Via Fбcil By. Paulo «*·ґЇ`·     ");
        print("                                        ");
        print("·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_ё.·ґЇ`·.ё_\n");
    }

    public OnPlayerConnect(playerid)
    {
            Pedagio[playerid] = 0;
            return 1;
    }

    public OnPlayerCommandText(playerid, cmdtext[])
    {
            if (strcmp(cmdtext, "/viafacil", true) == 0)
            {
                    new string[] = "Plano 1 - 10 Pass       R$ 1.000,00\nPlano 2 - 20 Pass  R$ 1.900,00\nPlano 3 - 30 Pass  R$ 2.800,00\nPlano 4 - 50 Pass  R$ 5.000,00\nPlano 5 - 100 Pass R$ 9.000,00";
                    ShowPlayerDialog(playerid, 5416, DIALOG_STYLE_LIST, "Plano - Via Fбcil", string, "Comprar", "Fechar");
                    return 1;
            }
            return 0;
    }

    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
            if(dialogid == 5416)
            {
                if(response)
                {
                    if(listitem == 0)
                    {
                        SendClientMessage(playerid, 0xFFFFFFFF, "Vocк comprou 10 Pass Via Fбcil!");
                        Jogador[playerid][ViaFacil] += 10;
                        GivePlayerMoney(playerid, -1000);
                        return 1;
                            }
                    if(listitem == 1)
                    {
                        SendClientMessage(playerid, 0xFFFFFFFF, "Vocк comprou 20 Pass Via Fбcil!");
                        Jogador[playerid][ViaFacil] += 20;
                        GivePlayerMoney(playerid, -1900);
                        return 1;
                            }
                    if(listitem == 2)
                    {
                        SendClientMessage(playerid, 0xFFFFFFFF, "Vocк comprou 30 Pass Via Fбcil!");
                        Jogador[playerid][ViaFacil] += 30;
                        GivePlayerMoney(playerid, -2800);
                        return 1;
                            }
                    if(listitem == 3)
                    {
                        SendClientMessage(playerid, 0xFFFFFFFF, "Vocк comprou 50 Pass Via Fбcil!");
                        Jogador[playerid][ViaFacil] += 50;
                        GivePlayerMoney(playerid, -5000);
                        return 1;
                            }
                    if(listitem == 4)
                    {
                        SendClientMessage(playerid, 0xFFFFFFFF, "Vocк comprou 100 Pass Via Fбcil!");
                        Jogador[playerid][ViaFacil] += 100;
                        GivePlayerMoney(playerid, -9000);
                        return 1;
                            }
                }
            }
            return 1;
    }

    forward CheckViaFacil();
    public CheckViaFacil()
    {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                    if(IsPlayerConnected(i))
                    {
                        if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
                        {
                            if(IsPlayerInRangeOfPoint(i, 5, 56.05, -1528.62, 4.67))
                            {
                                if(Jogador[i][ViaFacil] > 0 && Pedagio[i] == 0)
                                {
                                    SendClientMessage(i, 0xFFFFFFFF, "Via Fбcil: Vocк possui o plano Via Fбcil e nгo precisa parar! Boa Viagem.");
                                    Pedagio[i] = 1; //Evitar Flood
                                    Jogador[i][ViaFacil] --;
                                    SetObjectRot(Cancela1, 0.0000, 0.0000, 262.0000);
                                            }
                                            else if(Jogador[i][ViaFacil] == 0 && Pedagio[i] == 0)
                                            {
                                                    SendClientMessage(i, 0xFFFFFFFF, "Via Fбcil: Vocк nгo possui o plano Via Fбcil e precisa parar!");
                                    Pedagio[i] = 1; //Evitar Flood
                                    TogglePlayerControllable(i, false);
                                            SetTimerEx("Descongelar", 3000, false, "i", i);
                                    GivePlayerMoney(i, -500);
                                    SetObjectRot(Cancela1, 0.0000, 0.0000, 262.0000);
                                            }
                                    }
                                    else if(IsPlayerInRangeOfPoint(i, 5, 56.05, -1535.82, 4.71))
                            {
                                if(Jogador[i][ViaFacil] > 0 && Pedagio[i] < 1)
                                {
                                    SendClientMessage(i, 0xFFFFFFFF, "Via Fбcil: Vocк possui o plano Via Fбcil e nгo precisa parar! Boa Viagem.");
                                    Pedagio[i] = 1; //Evitar Flood
                                    Jogador[i][ViaFacil] --;
                                    SetObjectRot(Cancela2, 0.0000, 0.0000, 262.0000);
                                            }
                                            else if(Jogador[i][ViaFacil] == 0 && Pedagio[i] < 1)
                                            {
                                                    SendClientMessage(i, 0xFFFFFFFF, "Via Fбcil: Vocк nгo possui o plano Via Fбcil e precisa parar!");
                                    Pedagio[i] = 1; //Evitar Flood
                                    TogglePlayerControllable(i, false);
                                            SetTimerEx("Descongelar", 3000, false, "i", i);
                                    GivePlayerMoney(i, -500);
                                    SetObjectRot(Cancela2, 0.0000, 0.0000, 262.0000);
                                            }
                                    }
                                    else
                                    {
                        Pedagio[i] = 0;
                        SetObjectRot(Cancela1, 0.0000, 270.0000, 262.0000);
                        SetObjectRot(Cancela2, 0.0000, 90.0000, 262.0000);
                                    }
                        }
                    }
            }
            return 1;
    }

    forward Descongelar(i);
    public Descongelar(i)
    {
        TogglePlayerControllable(i, true);
            return 1;
    }
Arrume PF
й eu sei mas quando coloquei no OnFilterScriptInit nгo funcionou aki em casa ele nгo carregou os objectos e iniciou o timer entao fiz assim e deu certo. E nгo vejo problema algum em ser OnFilterScriptInit ou OnGameModeInit. mas vlw por comentar.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)