[FilterScript] Via Fбcil By. Paulo_TerroR
#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


Messages In This Thread
Via Fбcil By. Paulo_TerroR v2.0 - by paulor - 09.02.2012, 23:20
Respuesta: Via Fбcil By. Paulo_TerroR - by [Red]Maninho - 09.02.2012, 23:30
Re: Via Fбcil By. Paulo_TerroR - by Felipe_Freeze - 09.02.2012, 23:50
Re: Via Fбcil By. Paulo_TerroR - by Juninho_Oakley - 10.02.2012, 00:46
Re: Via Fбcil By. Paulo_TerroR - by Hard` - 10.02.2012, 00:48
Re: Via Fбcil By. Paulo_TerroR - by paulor - 10.02.2012, 11:09
Re: Via Fбcil By. Paulo_TerroR - by Hard` - 10.02.2012, 12:45
Re: Via Fбcil By. Paulo_TerroR - by paulor - 10.02.2012, 12:53
Re: Via Fбcil By. Paulo_TerroR - by Don_Speed - 10.02.2012, 13:07
Re: Via Fбcil By. Paulo_TerroR - by paulor - 10.02.2012, 13:33

Forum Jump:


Users browsing this thread: 1 Guest(s)