AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   Module: Parachute (not fake) (https://forums.alliedmods.net/showthread.php?t=189404)

joropito 07-06-2012 19:05

Module: Parachute (not fake)
 
2 Attachment(s)
Because too many people asked for this, I've made this little module.

All users in server has parachute, it activates with E (+use) while in air.
It only have one cvar

Quote:

sv_fallspeed (default: 100) // fall speed with parachute.
* Put parachute.wav into sound folder
* Put parachute.mdl into models folder
* Put the module into addons/amxmodx/modules
* Enable adding parachute in addons/amxmodx/configs/modules.ini

I only have linux build. Anyone willing to compile and test under windows will be helpful.

Destro- 07-06-2012 21:12

Re: Module: Parachute (not fake)
 
1 Attachment(s)
good


window version here

kiki33hun 07-07-2012 03:28

Re: Module: Parachute (not fake)
 
Good job!

dFF 07-07-2012 07:47

Re: Module: Parachute (not fake)
 
Nice joob joropito !
Can you add 2 natives something likes:
PHP Code:

native set_user_parachute(idbool:bStatus true)
native get_user_parachute(id

and a separate version without parachute sound ?

Also, Arkshine said on this topic using PlayerPreThink for plugin like parachute is not the very good way. Have you idea how to create parachute without PlayerPreThink functions ?
I have tried to make a parachute plugin without PlayerPreThink function, but have a problem with Cache_UnlinkLRU error.

ConnorMcLeod 07-07-2012 09:23

Re: Module: Parachute (not fake)
 
Quote:

Originally Posted by dFF (Post 1745278)
Nice joob joropito !
Can you add 2 natives something likes:
PHP Code:

native set_user_parachute(idbool:bStatus true)
native get_user_parachute(id

and a separate version without parachute sound ?

Also, Arkshine said on this topic using PlayerPreThink for plugin like parachute is not the very good way. Have you idea how to create parachute without PlayerPreThink functions ?
I have tried to make a parachute plugin without PlayerPreThink function, but have a problem with Cache_UnlinkLRU error.

It's not really a problem to use PreThink in a module, but i suggested to joropito to rewrite without prethink so he may consider it.

joropito 07-07-2012 09:57

Re: Module: Parachute (not fake)
 
I have to check if it's smooth to have an entity thinking each 0.1 and adding Z velocity to player. Also I want change the direction to what the player is viewing while flying.

This is just a method copy from the original parachute because lot of people asked to have it in a module. Of course there're some ways to improve this.

DjOptimuS 07-07-2012 10:51

Re: Module: Parachute (not fake)
 
well .. thank you very much joropito, i will buy you a beer.

Arkshine 07-07-2012 10:55

Re: Module: Parachute (not fake)
 
You can do it without, and using prethink is fairly overkill for that but there are some issues using others ways, that's why I have not released yet the new parachute plugin.

Anyway, except these unexpected problems where I'm working now to figure out some solution, the way I'm using is the following :

- Make the parachute thinking
- Hooking it
- Doing all the stuffs inside with timer.

The purpose is to have a number of actions as less as possible.

To do that, you can optimize things, like :

- Using +use to trigger only the parachute deployment. Meaning hooking ObjectCaps for the deploy only and not like the original where you need to hold +use.
- Using timer to lock the parachute step. Meaning, for example for deploy, the time necessary for the parachute to be fully deployed is > ~2s, so meanwhile this time, the plugin does nothing.
- Creating entity on new player only, unattach/hide it when not used, then delete it when the player is disconnected. No need each time to recreate the entity.
- Letting the engine making the model animation.

You can handle the speed fall differently :

- Method 1 : The smoothest, is to let the engine doing the things, by setting the player's gravity only. It means you will fall like a projectile and where you are going to have a constant acceleration. Such setting is largely enough for small maps or maps where you don't jump high, for example. (Parachute thinking set to 1 second, will explain below why)
- Method 2 : Smooth, using method 1, but to have a better fall approach, you set some basevelocity on z (and not velocity) each 0.1 second. It's good for all kinf of maps.
- Method 3 : Fairly smooth. You set some velocity on z, each 0.1 seconds. It's what does the original parachute plugin, you fall in a straight line in a constant speed. It's good for maps with large high ceiling.

About the method 1, I need to use some delay (1 second) to check if the player is on the ground. I've tried to find a forward which could handle such case, and did not find something useful. But it has the advantage to let some delay before the check, so for example, if you fall on someone or on an edge and you jump or keep falling, the parachute is not closed.

Some issues I have are :

- Some animations problems. It happens randomly. But It might because of my sucking code.
- Because the onground check is done after some time, and because by default the player's gravity is changed, if you jump and you are on the ground, you will make a big jump (because of gravity). A double-edge feature but fixing should not be too hard. (Already done more or less)

All these shits to say, well, parachute can be done in others ways, something way better. The issues should be fixable. But if joropito is on it, I guess no need to bother with my work anymore.

claudiuhks 07-07-2012 13:25

Re: Module: Parachute (not fake)
 
What do you mean with (not fake)?
By the way, it would be better to check whether entity exists through FNullEnt instead of getting the entity's index then check it whether is higher than zero.

joropito 07-07-2012 13:41

Re: Module: Parachute (not fake)
 
not fake thing: there was a fake parachute module with slowhack to forward players to some server

FNullEnt: it just check for entity equal to null. I prefer to check for less or equal zero. It's just different opcode, and don't change anything at asm code level.

guipatinador 07-07-2012 13:53

Re: Module: Parachute (not fake)
 
Thanks, I was looking for this some time ago (not fake :))
I will test it.

EDIT: Parachute open too late (~2sec).
EDIT2: joropito can you recompile with 1sec ?

Neeeeeeeeeel.- 07-07-2012 15:49

Re: Module: Parachute (not fake)
 
Good job, I will try it.

DjOptimuS 07-08-2012 06:26

Re: Module: Parachute (not fake)
 
parachute opens too late....i have same complaints.

Thank you.

claudiuhks 07-08-2012 07:55

Re: Module: Parachute (not fake)
 
Quote:

Originally Posted by joropito (Post 1745477)
not fake thing: there was a fake parachute module with slowhack to forward players to some server

FNullEnt: it just check for entity equal to null. I prefer to check for less or equal zero. It's just different opcode, and don't change anything at asm code level.

It's more easy for people to understand the code.
There is a different thing:

FNullEnt != 0 checks whether g_engfuncs.pfnEntOffsetOfPEntity is not null.
ENTINDEX > 0 checks whether g_engfuncs.pfnIndexOfEdict is higher than zero.

By the way, FNullEnt works with entities from -99999999 to 99999999 without crashing server.

Neeeeeeeeeel.- 07-09-2012 00:09

Re: Module: Parachute (not fake)
 
As others said, parachute opens like 2 seconds late (At least on windows version).

DjOptimuS 07-09-2012 03:02

Re: Module: Parachute (not fake)
 
Quote:

Originally Posted by Neeeeeeeeeel.- (Post 1746496)
As others said, parachute opens like 2 seconds late (At least on windows version).

I can confirm the same thing on linux build.

joropito 07-09-2012 10:10

Re: Module: Parachute (not fake)
 
I see nobody checked the source code. Yes, the parachute open after you have a minimum fall speed.
Why? Because you can't open the parachute just after you jump! That would be a mess... (in real world xD).

Also using this method you can't open parachute when you do a normal jump while running.


I will not make a few changes. I will wait to have more interesting requests then I will update the module.

xakintosh 07-09-2012 12:31

Re: Module: Parachute (not fake)
 
Maybe you can add little FOV effect to be more fun ( https://forums.alliedmods.net/showthread.php?t=3674 ), and maybe you can make the legs of player to be before him ( http://hdbox.bg/uclip.php?id=4573 )

claudiuhks 07-09-2012 14:18

Re: Module: Parachute (not fake)
 
No. Changing punchangle or v_angle.

Neeeeeeeeeel.- 07-09-2012 19:40

Re: Module: Parachute (not fake)
 
Maybe you can add a cvar to open (or not) the parachute after jump...

DjOptimuS 07-10-2012 03:32

Re: Module: Parachute (not fake)
 
Quote:

Originally Posted by Neeeeeeeeeel.- (Post 1747000)
Maybe you can add a cvar to open (or not) the parachute after jump...

This is a great ideea.

guipatinador 08-05-2012 15:33

Re: Module: Parachute (not fake)
 
Bump.
Can you make only 1sec?
I don't know how to compile modules.

PandaDnB 09-28-2012 15:13

Re: Module: Parachute (not fake)
 
Please fix the delay :(

Pastout 04-04-2013 15:40

Re: Module: Parachute (not fake)
 
I was doing some testing cause some people have ask me about this and I found a way without hooking client_prethink. I am also using gravity cause its really smooth and acts more realistic. Would be nice to see this in a module coded like this.

PHP Code:

#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
#include < fun >
#include < orpheu >
#include < orpheu_stocks >
 
new OrpheuStruct:g_ppmove;
 
#define PLUGIN        "Parachute"
#define VERSION        "1.0"
#define AUTHOR        ""
 
#define PARACHUTE_MODEL "models/parachute.mdl"
 
#define MAX_PLAYERS    32
 
#define MarkUserHasParachute(%0)    g_bitHasParachute |= (1<<(%0&31))
#define ClearUserHasParachute(%0)    g_bitHasParachute &= ~(1<<(%0&31))
#define HasUserParachute(%0)        g_bitHasParachute & (1<<(%0&31))
 
#define MarkUserUsingParachute(%0)    g_bitUsingParachute |= (1<<(%0&31))
#define ClearUserUsingParachute(%0)    g_bitUsingParachute &= ~(1<<(%0&31))
#define HasUserUsingParachute(%0)    g_bitUsingParachute & (1<<(%0&31))
 
#define MarkUserAliveParachute(%0)    g_bitAlive |= (1<<(%0&31))
#define ClearUserAliveParachute(%0)    g_bitAlive &= ~(1<<(%0&31))
#define HasUserAliveParachute(%0)    g_bitAlive & (1<<(%0&31))
 
new g_bitAlive
new g_bitUsingParachute
new g_bitHasParachute 
 
new g_iUserParachute[MAX_PLAYERS+1]
new 
Float:g_flEntityFrame[MAX_PLAYERS+1]
 
new 
g_iModelIndex
new g_pCvarFallSpeed
 
new const PARACHUTE_CLASS[] = "parachute"
 
enum {
    
deploy,
    
idle,
    
detach
}
 
public 
plugin_init() {
    
register_plugin(_PLUGIN_VERSION_AUTHOR)
    
g_pCvarFallSpeed register_cvar("parachute_fallspeed""0.0001")
 
    
RegisterHam(Ham_Spawn"player""Ham_CBasePlayer_Spawn_Post"1)
    
RegisterHam(Ham_Killed"player""Ham_CBasePlayer_Killed_Post"1)
 
    
OrpheuRegisterHookOrpheuGetDLLFunction"pfnPM_Move""PM_Move" ), "PM_Move" );
    
OrpheuRegisterHookOrpheuGetFunction"PM_FlyMove" ), "PM_FlyMove" );
    
OrpheuRegisterHookOrpheuGetFunction"PM_PlayStepSound" ), "PM_PlayStepSound" );
}
 
public 
plugin_precache() {
    
g_iModelIndex precache_model(PARACHUTE_MODEL)
}
 
public 
client_putinserver(id) {
    if( 
HasUserParachute(id) ) {
        new 
iEnt g_iUserParachute[id]
        if( 
iEnt ) {
            
RemoveUserParachute(idiEnt)
        }
        
ClearUserHasParachute(id)
 
    }
    
ClearUserAliveParachute(id)
}
 
public 
client_disconnect(id) {
    if( 
HasUserParachute(id) ) {
        new 
iEnt g_iUserParachute[id]
        if( 
iEnt ) {
            
RemoveUserParachute(idiEnt)
        }
        
ClearUserHasParachute(id)
    }
    
ClearUserAliveParachute(id)
}
 
public 
Ham_CBasePlayer_Killed_Postid ) {
    if( 
HasUserParachute(id) ) {
        new 
iEnt g_iUserParachute[id]
        if( 
iEnt ) {
            
RemoveUserParachute(idiEnt)
        }
        
ClearUserHasParachute(id)
    }
    
ClearUserAliveParachute(id)
}
 
new 
Float:get_userGravity33 ]
new 
Float:get_cvar
 
public Ham_CBasePlayer_Spawn_Post(id) {
    if( 
is_user_alive(id) ) {
        
get_cvar get_pcvar_float(g_pCvarFallSpeed)
        
get_userGravityid ] = get_user_gravity(id)
        if( 
HasUserParachute(id) ) {
            new 
iEnt g_iUserParachute[id]
            if( 
iEnt ) {
                
RemoveUserParachute(idiEnt)
            }
        }
        
MarkUserHasParachute(id)
        
MarkUserAliveParachute(id)
    }
}
 
RemoveUserParachute(idiEnt) {
    
engfunc(EngFunc_RemoveEntityiEnt)
    
g_iUserParachute[id] = 0
    set_user_gravity
(idget_userGravityid ])
    
ClearUserUsingParachute(id)
}
 
CreateParachute(id) {
    static 
iszInfoTarget
    
if( !iszInfoTarget ) {
        
iszInfoTarget engfunc(EngFunc_AllocString"info_target")
    }
    new 
iEnt engfunc(EngFunc_CreateNamedEntityiszInfoTarget)
    if( 
iEnt 0) {
        static 
iszClass 0
        
if( !iszClass ) {
            
iszClass engfunc(EngFunc_AllocStringPARACHUTE_CLASS)
        }
        
set_pev_string(iEntpev_classnameiszClass)
        
set_pev(iEntpev_aimentid)
        
set_pev(iEntpev_ownerid)
        
set_pev(iEntpev_movetypeMOVETYPE_FOLLOW)
        static 
iszModel 0
        
if( !iszModel ) {
            
iszModel engfunc(EngFunc_AllocStringPARACHUTE_MODEL)
        }
        
set_pev_string(iEntpev_modeliszModel)
        
set_pev(iEntpev_modelindexg_iModelIndex)
        
set_pev(iEntpev_sequencedeploy)
        
set_pev(iEntpev_gaitsequence1)
        
set_pev(iEntpev_frame0.0)
 
        
set_pev(iEntpev_rendermodepev(idpev_rendermode));
        
set_pev(iEntpev_renderfxpev(idpev_renderfx));
        new 
Float:f_renderamt;
        
pev(idpev_renderamtf_renderamt);
        
set_pev(iEntpev_renderamtf_renderamt);
 
        
g_flEntityFrame[id] = 0.0
        g_iUserParachute
[id] = iEnt
        MarkUserHasParachute
(id)
        new 
Float:fVecOrigin[3]
        
pev(idpev_originfVecOrigin)
 
        return 
iEnt
    
}
    return 
0
}
 
public 
OrpheuHookReturn:PM_MoveOrpheuStruct:ppmoveserver )
{
    
g_ppmove ppmove;
 
    return 
OrpheuIgnored;
}
 
public 
OrpheuHookReturn:PM_PlayStepSound( )
{
    new 
id OrpheuGetStructMemberg_ppmove"player_index" ) + 1;
 
    if( ~
HasUserParachute(id) && ~HasUserAliveParachute(id)) {
        return 
OrpheuIgnored;
    }
    new 
iEnt g_iUserParachute[id]
    if(
iEnt && HasUserUsingParachute(id) ) {
 
        
RemoveUserParachute(idiEnt)
    }
 
    return 
OrpheuIgnored;
}
 
public 
OrpheuHookReturn:PM_FlyMove( )
{
    new 
id OrpheuGetStructMemberg_ppmove"player_index" ) + 1;
    new 
Float:flFrame
    
new iEnt g_iUserParachute[id]
    if( 
pev(idpev_button) & IN_USE ) {
        new 
Float:fVecVelocity[3], Float:fVelocity_z
        pev
(idpev_velocityfVecVelocity)
        
fVelocity_z fVecVelocity[2]
        if( 
fVelocity_z 0.0 ) {
            if(
iEnt <= 0) {
                
iEnt CreateParachute(id)
            }
            
//fVelocity_z = floatmin(fVelocity_z + 14.0, -get_pcvar_float(g_pCvarFallSpeed))
            //fVecVelocity[2] = fVelocity_z
            //set_pev(id, pev_velocity, fVecVelocity)
 
            
MarkUserUsingParachute(id)
            
set_user_gravity(id, (get_userGravityid ]/4)+get_cvar)
            if( 
pev(iEntpev_sequence) == deploy ) {
                
flFrame g_flEntityFrame[id]++
                if( 
flFrame 100.0 ) {
                    
set_pev(iEntpev_animtime0.0)
                    
set_pev(iEntpev_framerate0.4)
                    
set_pev(iEntpev_sequenceidle)
                    
set_pev(iEntpev_gaitsequence1)
                    
set_pev(iEntpev_frame0.0)
                    
g_flEntityFrame[id] = 0.0
                
}
                else {
                    
set_pev(iEntpev_frameflFrame)
                }
            }
        }
        else if(
iEnt 0) {
            
RemoveUserParachute(idiEnt)
        }
    }
    else if( 
iEnt && pev(idpev_oldbuttons) & IN_USE ) {
        
RemoveUserParachute(idiEnt)
    }
 
    return 
OrpheuIgnored;



ConnorMcLeod 04-04-2013 16:36

Re: Module: Parachute (not fake)
 
PM_Move is not better than prethink ;)
And hook prethink in a module is not a problem.

Pastout 04-05-2013 17:59

Re: Module: Parachute (not fake)
 
1 Attachment(s)
Ok made a new. Really i think this is the best way to do this. Its the most realistic and best performance I think. Please give me feedback on this.

PHP Code:

#include < amxmodx >
#include < fakemeta >
#include < engine >
#include < hamsandwich >
#include < fun >
 
new g_szPluginInfo[3][10] = { "Parachute""1.0""Pastout" }
 
#define PARACHUTE_MODEL "models/angel2.mdl"
#define MAX_PLAYERS    32
 
#define MarkUserHasParachute(%0)    g_bitHasParachute |= (1<<(%0&31))
#define ClearUserHasParachute(%0)   g_bitHasParachute &= ~(1<<(%0&31))
#define HasUserParachute(%0)        g_bitHasParachute & (1<<(%0&31))
 
#define MarkUserAlive(%0)       g_bitAlive |= (1<<(%0&31))
#define ClearUserAlive(%0)      g_bitAlive &= ~(1<<(%0&31))
#define GetUserAlive(%0)        g_bitAlive & (1<<(%0&31))
 
#define MarkUserButton(%0)      g_bitButton |= (1<<(%0&31))
#define ClearUserButton(%0)     g_bitButton &= ~(1<<(%0&31))
#define GetUserButton(%0)       g_bitButton & (1<<(%0&31))
 
new g_bitAlive
new g_bitHasParachute 
new g_bitButton
 
new g_iUserParachute[MAX_PLAYERS+1]
new 
Float:g_flEntityFrame[MAX_PLAYERS+1]
new 
Float:get_userGravity[MAX_PLAYERS+1]
 
new 
g_iModelIndex
 
new g_pCvarFallSpeedg_pCvarDeploySpeed
 
//const m_afButtonPressed = 246
const m_afButtonReleased 247
new const PARACHUTE_CLASS[] = "parachute"
 
new Float:get_cvar[2]
 
enum {
    
PARA_FALLSPEED,
    
PARA_DEPLOYSPEED
}
 
enum {
    
deploy,
    
idle,
    
detach
}
 
public 
plugin_init() {
    
register_plugin(g_szPluginInfo[0], g_szPluginInfo[1], g_szPluginInfo[2])
    
g_pCvarFallSpeed register_cvar("p_fallspeed""0.05")
    
g_pCvarDeploySpeed register_cvar("p_deployspeed""0.01")
 
    static 
g_szPlayer[] = "player"
    
RegisterHam(Ham_Spawng_szPlayer"Ham_CBasePlayer_Spawn_Post", .Post true)
    
RegisterHam(Ham_Killedg_szPlayer"Ham_CBasePlayer_Killed_Post", .Post true)
    
RegisterHam(Ham_ObjectCapsg_szPlayer"Ham_CBasePlayer_ObjectCaps", .Post false)
 
    
register_forward(FM_CmdStart"FM_CBasePlayer_CmdStart")
 
    
register_event("HLTV""Event_NewRound""a""1=0""2=0")
 
    
register_think(PARACHUTE_CLASSg_szPluginInfo[0])
}
 
public 
plugin_precache()
    
g_iModelIndex precache_model(PARACHUTE_MODEL)
 
public 
client_putinserver(id
    
ClearUserAlive(id)
 
public 
client_disconnect(id) {
    
SetParachuteSettings(id)
 
    
ClearUserAlive(id)
}
 
public 
Ham_CBasePlayer_Killed_Postid ) {
    
SetParachuteSettings(id)
 
    
ClearUserAlive(id)
}
 
public 
Event_NewRound( ) {
    
get_cvar[0] = get_pcvar_float(g_pCvarFallSpeed)
    
get_cvar[1] = get_pcvar_float(g_pCvarDeploySpeed)
}
 
public 
Ham_CBasePlayer_Spawn_Post(id) {
    if( 
is_user_alive(id) ) {
        
SetParachuteSettings(id)
        
ClearUserButton(id)
        
MarkUserAlive(id)
    }
}
 
SetParachuteSettings(id)
    if( 
HasUserParachute(id) ) 
        
RemoveUserParachute(id)
 
RemoveUserParachute(id) {
    new 
iEnt g_iUserParachute[id]
    if(
iEnt
        
engfunc(EngFunc_RemoveEntityiEnt)
 
    
g_iUserParachute[id] = 0
 
    set_user_gravity
(idget_userGravity[id])
 
    
ClearUserHasParachute(id)
}
 
public 
FM_CBasePlayer_CmdStart(idhandle)
    if(
GetUserAlive(id))
        if( 
entity_get_intidEV_INT_button ) & IN_USE )
            
MarkUserButton(id)
 
public 
Ham_CBasePlayer_ObjectCaps(id) {
    if(
GetUserButton(id))
    {
        new 
flags get_entity_flags(id)
 
        new 
isOnGround flags FL_ONGROUND
        
new isInWater = (pev(idpev_waterlevel) > 0)
        if(~
HasUserParachute(id) && GetUserButton(id)) {
            if( 
isOnGround || isInWater 
                return
 
            
//client_print(id, print_chat, "Created parachute")
            
get_userGravity[id] = get_user_gravity(id)
 
            
CreateParachute(id)
        }
        else if(
HasUserParachute(id) && get_pdata_int(idm_afButtonReleased) & IN_USE) {
            
//client_print(id, print_chat, "You release IN_USE NO more parachute" )
            
RemoveUserParachute(id)
            
ClearUserButton(id)
        }
        if(
HasUserParachute(id) && ( isOnGround || isInWater ) ) {
            
//client_print(id, print_chat, "NO more parachute on ground" )
            
RemoveUserParachute(id)
        }
    }
}
 
CreateParachute(id) {
    static 
iszInfoTarget
    
if( !iszInfoTarget ) {
        
iszInfoTarget engfunc(EngFunc_AllocString"info_target")
    }
    new 
iEnt engfunc(EngFunc_CreateNamedEntityiszInfoTarget)
    if( 
iEnt 0) {
        static 
iszClass 0
        
if( !iszClass ) {
            
iszClass engfunc(EngFunc_AllocStringPARACHUTE_CLASS)
        }
        
set_pev_string(iEntpev_classnameiszClass)
        
set_pev(iEntpev_aimentid)
        
set_pev(iEntpev_ownerid)
        
set_pev(iEntpev_movetypeMOVETYPE_FOLLOW)
        static 
iszModel 0
        
if( !iszModel ) {
            
iszModel engfunc(EngFunc_AllocStringPARACHUTE_MODEL)
        }
        
set_pev_string(iEntpev_modeliszModel)
        
set_pev(iEntpev_modelindexg_iModelIndex)
        
set_pev(iEntpev_sequencedeploy)
        
set_pev(iEntpev_gaitsequence1)
        
set_pev(iEntpev_frame0.0)
 
        
set_pev(iEntpev_rendermodepev(idpev_rendermode))
        
set_pev(iEntpev_renderfxpev(idpev_renderfx))
        new 
Float:f_renderamt
        pev
(idpev_renderamtf_renderamt)
        
set_pev(iEntpev_renderamtf_renderamt)
 
        
g_flEntityFrame[id] = 0.0
        g_iUserParachute
[id] = iEnt
 
        MarkUserHasParachute
(id)
 
        new 
Float:fVecOrigin[3]
        
pev(idpev_originfVecOrigin)
 
        
set_pev(iEntpev_nextthinkget_gametime() + get_cvar[1])
 
        return 
iEnt
    
}
    return 
0
}
 
public 
Parachute(iEnt)
{
    if(!
pev_valid(iEnt))
        return
 
    static 
id
    id 
pev(iEntpev_owner)
    new 
Float:flFrame
    
new iEnt g_iUserParachute[id]
 
    if( 
HasUserParachute(id) ) {
        new 
Float:fVecVelocity[3], Float:fVelocity_z
        pev
(idpev_velocityfVecVelocity)
        
fVelocity_z fVecVelocity[2]
        if( 
fVelocity_z 0.0 ) {
            if(
iEnt <= 0) {
                
iEnt CreateParachute(id)
            }
            
//fVelocity_z = floatmin(fVelocity_z + 14.0, -get_cvar[PARA_FALLSPEED])
            //fVecVelocity[2] = fVelocity_z
            //set_pev(id, pev_velocity, fVecVelocity)
            
set_user_gravity(idget_cvar[0]+get_cvar[0])
            if( 
pev(iEntpev_sequence) == deploy) {
                
flFrame g_flEntityFrame[id]++
                if(
flFrame 100.0) {
                    
set_pev(iEntpev_animtime0.0)
                    
set_pev(iEntpev_framerate0.4)
                    
set_pev(iEntpev_sequenceidle)
                    
set_pev(iEntpev_gaitsequence1)
                    
set_pev(iEntpev_frame0.0)
                    
g_flEntityFrame[id] = 0.0
                
}
                else {
                    
set_pev(iEntpev_frameflFrame)
                }
            }
        }
    }
    
set_pev(iEntpev_nextthinkget_gametime() + 0.01)



ConnorMcLeod 04-06-2013 05:36

Re: Module: Parachute (not fake)
 
Why don't you post in plugin parachute thread ?

bibu 04-06-2013 08:21

Re: Module: Parachute (not fake)
 
Btw, check this Pastout:

http://forums.alliedmods.net/showpos...94&postcount=9

Pastout 04-06-2013 12:31

Re: Module: Parachute (not fake)
 
Quote:

Originally Posted by bibu (Post 1927332)

I know that, but if you read the code it will auto correct itself. Btw the chances of that happening are still very low and even if it does like i said it will auto correct itself.

But im done. This was only to improve the parachute plugin without using prethink or cmdstart

guipatinador 07-27-2013 14:27

Re: Module: Parachute (not fake)
 
1 Attachment(s)
Quote:

Originally Posted by Neeeeeeeeeel.- (Post 1747000)
Maybe you can add a cvar to open (or not) the parachute after jump...

Here is.

Code:

sv_fallspeed 100 // fall speed with parachute
sv_min_fallspeed_to_open 300.0 // minimum fall speed to open the parachute. If you want the parachute to open fast, set a low value

linux version only.

Apb hq 01-31-2016 05:52

Re: Module: Parachute (not fake)
 
Is it possible to add a cvar for new parachute model ?

counter1strike6 03-11-2016 14:45

Re: Module: Parachute (not fake)
 
i cant compile

the terminal output tried gcc & g++
PHP Code:

make OPT=opt
mkdir 
-p Release
mkdir 
-p Release/sdk
make parachute
make
[1]: Entering directory `/root/Desktop/parachute'
g++ -I. -I/home/include/hlsdk -I/home/include/hlsdk/dlls -I/home/include/hlsdk/engine -I/home/include/hlsdk/public -I/home/include/hlsdk/game_shared -I/home/include/hlsdk/game_shared -I/home/include/metamod/metamod -I/home/include/hlsdk/common -I/home/include/hlsdk/pm_shared -Isdk -Iinclude -I -O2 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -march=i586 -DNDEBUG -Wno-non-virtual-dtor -DHAVE_STDINT_H -static-libgcc -m32 -DREVISION=
`svnversion -n` -DPAWN_CELL_SIZE=32 -DJIT -DASM32 -o Release/sdk/amxxmodule.o -c sdk/amxxmodule.cpp
g++ -I. -I/home/include/hlsdk -I/home/include/hlsdk/dlls -I/home/include/hlsdk/engine -I/home/include/hlsdk/public -I/home/include/hlsdk/game_shared -I/home/include/hlsdk/game_shared -I/home/include/metamod/metamod -I/home/include/hlsdk/common -I/home/include/hlsdk/pm_shared -Isdk -Iinclude -I -O2 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -march=i586 -DNDEBUG -Wno-non-virtual-dtor -DHAVE_STDINT_H -static-libgcc -m32 -DREVISION=
`svnversion -n` -DPAWN_CELL_SIZE=32 -DJIT -DASM32 -o Release/parachute.o -c parachute.cpp
g++: error: directory: No such file or directory
make[1]: *** [Release/sdk/amxxmodule.o] Error 1
make[1]: *** Waiting for unfinished jobs....
g++: error: directory: No such file or directory
make[1]: *** [Release/parachute.o] Error 1
make[1]: Leaving directory 
`/root/Desktop/parachute'
make: *** [all] Error 2 


Depresie 03-13-2016 21:46

Re: Module: Parachute (not fake)
 
Ahm, it could be done more efficient, maybe with cmdstart..
But arkshine gave me an ideea

Hook a command like radio1 to deploy parachute, store player's original gravity ( to avoid bugs on mods such zombie plague where player's have different gravity values ) press again to close the parachute, restore gravity, register touch and when players touches the ground, automaticaly close the parachute

ish12321 12-03-2016 15:32

Re: Module: Parachute (not fake)
 
If a user isin air with parachute open and that time he dies
Hisbody is stuck in that position and doesn't disappear for a while

ish12321 12-13-2016 14:18

Re: Module: Parachute (not fake)
 
Quote:

Originally Posted by ish12321 (Post 2474892)
If a user isin air with parachute open and that time he dies
Hisbody is stuck in that position and doesn't disappear for a while

BUMP

Siska1 04-09-2023 07:56

Re: Module: Parachute (not fake)
 
Can someone make this module work with regamedll bots too?
To work with zbots ?


All times are GMT -4. The time now is 13:16.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.