Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
NiGHT

[CS:GO] - [Plugin] "Parachute"

Recommended Posts

  • Descriere:  Parasuta simplificata, optimizata, fara modele, fara optiuni de cumparare/vanzare,
  • Descărcare: 
    #include <sourcemod>
    #include <sdktools>
    #pragma newdecls required
    #define PARACHUTE_VERSION   "2.5"
     
    int g_iVelocity = -1;
     
    ConVar g_cvarFallspeed;
    ConVar g_cvarLinear;
    ConVar g_cvarDecrease;
    int g_iFallSpeed;
    int g_iLinear;
    float g_fDecrease;
     
    int cl_flags;
    float speed[3];
    bool isfallspeed;
     
    bool inUse[MAXPLAYERS+1];
     
    public Plugin myinfo =
    {
        name = "SM Parachute",
        author = "SWAT_88",
        description = "To use your parachute press and hold your E(+use) button while falling.",
        version = PARACHUTE_VERSION,
        url = "http://www.sourcemod.net/"
    };
     
    public void OnPluginStart()
    {
        g_cvarFallspeed = CreateConVar("sm_parachute_fallspeed","100");
        g_cvarLinear = CreateConVar("sm_parachute_linear","1");
        g_cvarDecrease = CreateConVar("sm_parachute_decrease","50");
        g_iVelocity = FindSendPropInfo("CBasePlayer""m_vecVelocity[0]");
     
        g_cvarFallspeed.AddChangeHook(OnSettingsChanged);
        g_cvarLinear.AddChangeHook(OnSettingsChanged);
        g_cvarDecrease.AddChangeHook(OnSettingsChanged);
     
        HookEvent("player_death", PlayerDeath);
    }
     
    public void OnConfigsExecuted()
    {
        g_iFallSpeed = g_cvarFallspeed.IntValue;
        g_iLinear = g_cvarLinear.IntValue;
        g_fDecrease = g_cvarDecrease.FloatValue;
    }
     
    public void OnSettingsChanged(ConVar cvar, const char[] oldval, const char[] newval)
    {
        if(cvar == g_cvarFallspeed)
            g_iFallSpeed = g_cvarFallspeed.IntValue;
        else if(cvar == g_cvarLinear)
            g_iLinear = g_cvarLinear.IntValue;
        else if(cvar == g_cvarDecrease)
            g_fDecrease = g_cvarDecrease.FloatValue;
    }
     
    public void OnClientPutInServer(int client)
    {
        inUse[client] = false;
    }
     
    public Action PlayerDeath(Event event, const char[] name, bool dontBroadcast){
        EndPara(GetClientOfUserId(event.GetInt("userid")));
        return Plugin_Continue;
    }
     
    void StartPara(int client)
    {
        static float velocity[3];
        static float fallspeed;
        if (g_iVelocity == -1return;
        fallspeed = g_iFallSpeed*(-1.0);
        GetEntDataVector(client, g_iVelocity, velocity);
        if(velocity[2] >= fallspeed){
            isfallspeed = true;
        }
        if(velocity[2] < 0.0) {
            if(isfallspeed && g_iLinear == 0){
            }
            else if((isfallspeed && g_iLinear == 1) || g_fDecrease == 0.0){
                velocity[2] = fallspeed;
            }
            else{
                velocity[2] = velocity[2] + g_fDecrease;
            }
            TeleportEntity(client, NULL_VECTORNULL_VECTOR, velocity);
            SetEntDataVector(client, g_iVelocity, velocity);
            SetEntityGravity(client,0.1);
        }
    }
     
    void EndPara(int client)
    {
        SetEntityGravity(client,1.0);
        inUse[client]=false;
    }
     
    void Check(int client){
            GetEntDataVector(client,g_iVelocity,speed);
            cl_flags = GetEntityFlags(client);
            if(speed[2] >= 0 || (cl_flags & FL_ONGROUND)) EndPara(client);
    }
     
    public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2])
    {
        if(IsPlayerAlive(client))
        {
            if (buttons & IN_USE)
            {
                if (!inUse[client])
                {
                    inUse[client] = true;
                    isfallspeed = false;
                    StartPara(client);
                }
                StartPara(client);
            }
            else
            {
                if (inUse[client])
                {
                    inUse[client] = false;
                    EndPara(client);
                }
            }
            Check(client);
        }
    }

     

  • Denumire plugin: [CS:GO] Parachute
  • Link oficial: - 
  • Imagini (opţional): - 
  • Alte precizari/detalii: -
  • Love 1

b_560_95_1.png

 

-> DISCORD <-

-> STEAM <-

-> STEAM GROUP <-

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Also by continuing using this website you agree with the Terms of Use and Privacy Policy.