SSGamers - 12 Anos online por você.

#SSGamers - A Comunidade que mais crescer no brasil!

Participe do fórum, é rápido e fácil

SSGamers - 12 Anos online por você.

#SSGamers - A Comunidade que mais crescer no brasil!

SSGamers - 12 Anos online por você.

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Chegou o novo tema 6.5.5 - SSGamers - Servidores online de qualidade - Aproveite e entre para nossa comunidade, inscreva-se já! - Ouça nossa web radio - Veja nossas novidades - Participe dos nossos setores de jogos online - Parcerias aberta fale já com um administrador.

2 participantes

    Sistema de Descida em Rappel automatizado [FilterScript]

    Đค૨кᙖ๏ყ
    Đค૨кᙖ๏ყ
    --> Postador Iniciante
    --> Postador Iniciante


    Steam Steam : Darkboyzinho
    Celular : +351964693515
    Mensagens : 12
    Moedas : 3782
    Data de inscrição : 10/01/2014
    Idade : 30
    Localização : Porto, Portugal

    Sistema de Descida em Rappel automatizado [FilterScript] Empty Sistema de Descida em Rappel automatizado [FilterScript]

    Mensagem por Đค૨кᙖ๏ყ Ter 4 Ago 2015 - 20:04

    Ola Pessoal neste filterscript e como o titulo fala e um sistema de Rappel para descer de um Maverick.

    Como funciona? Simples, se pressionar Space (Saltar) e estiver a cair antes de chegar ao chao o rappel ira comecar, tambem se estiver dentro de um Maverick e nao for o condutor so precisa de pressionar a tecla para saltar e voce ira fazer rappel ate o chao automaticamente. Sem comandos.


    Pastebin:




    Código:
    /*==============================================================================


    ----------------------------De4dpOol's rappelling System------------------------


    ==============================================================================*/


     


    //Include(s)


    #include <a_samp>


    #include <zcmd>


    #include <line>


     


    //Forward(s)//


    forward FallingChecker(playerid);


    forward DeActivateRappel(playerid);


     


    //New(s)//


    new Float:LastZ[MAX_PLAYERS];


    new Rope[MAX_PLAYERS];


    new IsRappelling[MAX_PLAYERS];


    new LandingChecker[MAX_PLAYERS];


    new Rappel[MAX_PLAYERS];


    new Float:PlayerHealth[MAX_PLAYERS];


     


    //Function(s)//


    GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)


    {


            new Float:a;


            GetPlayerPos(playerid, x, y, a);


            GetPlayerFacingAngle(playerid, a);


            if (GetPlayerVehicleID(playerid))


            {


              GetVehicleZAngle(GetPlayerVehicleID(playerid), a);


            }


            x += (distance * floatsin(-a, degrees));


            y += (distance * floatcos(-a, degrees));


    }


     


    RappelPlayer(playerid)


    {


        new Float: Px, Float: Py, Float: Pz;


        GetPlayerPos(playerid, Px, Py, Pz);


        GetXYInFrontOfPlayer(playerid, Px, Py, 0.2);


        SetPlayerVelocity(playerid, 0.0, 0.0, -0.2);


            Rope[playerid] = CreateLineSegment(19087, 2.46,
     Px, Py, Pz, Px, Py, Pz - 1000.0, .RotX = 90.0, .objlengthoffset =
    -(2.46/2), .worldid = -1, .interiorid = -1, .playerid = -1, .maxlength =
     1000.0);


            ApplyAnimation(playerid,"ped","abseil",4.0,0,0,0,1,0);


            return 1;


    }


     


    NotFalling(playerid)


    {


            DestroyLineSegment(Rope[playerid]);


            ClearAnimations(playerid);


            IsRappelling[playerid] = 0;


            KillTimer(LandingChecker[playerid]);


            SetPlayerHealth(playerid, PlayerHealth[playerid]);


            return 1;


    }


     


    //Public(s)


    public OnPlayerUpdate(playerid)


    {


            if(Rappel[playerid] == 0) return 1;


        if(GetPlayerAnimationIndex(playerid) && (IsRappelling[playerid] == 0))


        {


            new animlib[32];


            new animname[32];


            GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);


            if((!strcmp(animlib, "PED", true, 3)) && (!strcmp(animname, "FALL_fall", true, 9)))


            {


               RappelPlayer(playerid);


               IsRappelling[playerid] = 1;


               GetPlayerHealth(playerid, PlayerHealth[playerid]);


               SetPlayerHealth(playerid, 999999.0);


               LandingChecker[playerid] = SetTimerEx("FallingChecker",500,1,"i",playerid);


            }


        }


        return 1;


    }


     


    public FallingChecker(playerid)


    {


        new Float:z;


        GetPlayerPos(playerid,z,z,z);


        if(LastZ[playerid] == z)


        {


            NotFalling(playerid);


            }


        LastZ[playerid] = z;


        return 1;


    }


     


    public OnPlayerDisconnect(playerid, reason)


    {


            if(IsValidLineSegment(Rope[playerid])) DestroyLineSegment(Rope[playerid]);


        Rappel[playerid] = 0;


        IsRappelling[playerid] = 0;


        KillTimer(LandingChecker[playerid]);


            return 1;


    }


     


    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)


    {


            if((newkeys & KEY_JUMP) && (Rappel[playerid] == 0))


            {


                    if(IsPlayerInAnyVehicle(playerid))


                    {


                           
    if((GetVehicleModel(GetPlayerVehicleID(playerid)) == 487) &&
    (GetPlayerVehicleSeat(playerid) != 0))//If its a Marverick and player is
     a passenger.


                            {


                    RemovePlayerFromVehicle(playerid);


                            }


                    }


                    Rappel[playerid] = 1;


                    SetTimerEx("DeActivateRappel", 5000, 0, "i", playerid);


            }


            return 1;


    }


     


    public DeActivateRappel(playerid)


    {


            Rappel[playerid] = 0;


            return 1;


    }


     


    //Cmd(s)//


    CMD:test2(playerid, params[])//To activate Rappelling, press jump to start rappelling.


    {


            SetPlayerPos(playerid, 0.0, 0.0, 200.0);


            return 1;


    }


    /*==============================================================================


    ---------------------------------End of Script----------------------------------

    ==============================================================================*/


    Stremmer_Scripter#0961
    Stremmer_Scripter#0961
    --> Postador Fanático
    --> Postador Fanático


    Celular : 17981120325
    Mensagens : 681
    Moedas : 2987
    Data de inscrição : 19/10/2019
    Idade : 28

    Sistema de Descida em Rappel automatizado [FilterScript] Empty Re: Sistema de Descida em Rappel automatizado [FilterScript]

    Mensagem por Stremmer_Scripter#0961 Dom 2 Jan 2022 - 19:14

    bem feito traga sempre por aki

      Data/hora atual: Sex 19 Abr 2024 - 4:16