Raised This Month: $32 Target: $400
 8% 

Parachute 1.3 (KRoTaL)


Post New Thread Reply   
 
Thread Tools Display Modes
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 12-31-2014 , 11:13   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #231

Still :/ while falling on map for example 1hp, that is 1-2 seconds so I thought you can make something that will activate it after 5 seconds.. That doesn't work :/
TheBladerX is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-31-2014 , 11:28   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #232

Just edit 10.0 value into anything less or more:
Code:
public logevent_round_start()
{
    // Free parachute after 10s of round start. ;)
    set_task(10.0, "FreePara")
}
zmd94 is offline
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 12-31-2014 , 11:39   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #233

Still gives parachute immediately, this is weird.. But thanks for help
TheBladerX is offline
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 12-31-2014 , 11:42   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #234

Ah I think I know what's wrong. I ment to activate parachute after 5 seconds not first 5 seconds
TheBladerX is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-31-2014 , 11:52   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #235

I have updated the code:

https://forums.alliedmods.net/showpo...&postcount=230
zmd94 is offline
new_holland6
New Member
Join Date: Jan 2015
Old 01-02-2015 , 16:45   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #236

Hello there! How are you? If there is anyone who get bored, can help me with my server?, it's everything working except parachute. In fact i put the plugin, if i wrote amx_plugins in comsole it show me its working, in chat it gives me the message from parachute.txt, but it doesen't work to activate on E, even if the plugin is tested on other servers. Anyway i had in the begining another plugin, but it wasn't working properly, if one player use the parachute , the other ones doesent have it anymore... so i remplaced it with this one, but now its not working at all. Its for FREE parachute, so the reason it doesent work because i didn't buy it is not a valid one... Because also chat print is : You allready have a parachute! I dont know whats wrong. If anyone can help me i would be really happy. Thanks!!!
new_holland6 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-02-2015 , 19:41   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #237

If you want to give parachute to all players for free, just use this:

https://forums.alliedmods.net/showthread.php?t=175775

Although it is in ZP section, you still can use that plugin in regular CS1.6 mods. I have tested it and it is working well in my server.
zmd94 is offline
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 01-09-2015 , 08:41   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #238

Looks like mine doesn't work, still... Can you set 5 seconds after player respawn, please?
TheBladerX is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-09-2015 , 09:18   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #239

Just try below:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define _PLUGIN         "[ZP] Parachute"
#define _VERSION             "1.0"
#define _AUTHOR           "H.RED.ZONE"

#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))

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""30")
    
    
register_forwardFM_CmdStart"fw_Start" )
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerRespawn"1)
    
RegisterHam(Ham_Killed"player""Ham_CBasePlayer_Killed_Post"1)
}

public 
plugin_precache() {
    
g_iModelIndex precache_model(PARACHUTE_MODEL)
}

public 
fw_PlayerRespawn(id)
{
    
// Free parachute after 10s of round start. ;)
    
set_task(5.0"FreePara")
}

public 
FreePara() 
{
    new 
iPlayers[32], iPlayerCountiid
    
    get_players
(iPlayersiPlayerCount"a"
    for(
0iPlayerCounti++)
    {
        
id iPlayers[i]

        if( 
HasUserParachute(id) ) 
        {
            new 
iEnt g_iUserParachute[id]
            if( 
iEnt 
            {
                
RemoveUserParachute(idiEnt)
            }
        }
            
        
MarkUserHasParachute(id)
    }
}

public 
client_disconnect(id) {
    if( 
HasUserParachute(id) ) {
        new 
iEnt g_iUserParachute[id]
        if( 
iEnt ) {
            
RemoveUserParachute(idiEnt)
        }
        
ClearUserHasParachute(id)
    }
}

public 
Ham_CBasePlayer_Killed_Postid ) {
    if( 
HasUserParachute(id) ) {
        new 
iEnt g_iUserParachute[id]
        if( 
iEnt ) {
            
RemoveUserParachute(idiEnt)
        }
        
ClearUserHasParachute(id)
    }
}

RemoveUserParachute(idiEnt) {
    
engfunc(EngFunc_RemoveEntityiEnt)
    
g_iUserParachute[id] = 0
}

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)
        
g_flEntityFrame[id] = 0.0
        g_iUserParachute
[id] = iEnt
        MarkUserHasParachute
(id)
        new 
Float:fVecOrigin[3]
        
pev(idpev_originfVecOrigin)
        
        return 
iEnt
    
}
    return 
0
}

public 
fw_Start(id) {
    if( ~
HasUserParachute(id) || !is_user_alive(id) ) {
        return
    }

    new 
Float:flFrame
    
new iEnt g_iUserParachute[id]

    if(
iEnt && pev(idpev_flags) & FL_ONGROUND) {

        if( 
pev(iEntpev_sequence) != detach ) {
            
set_pev(iEntpev_sequencedetach)
            
set_pev(iEntpev_gaitsequence1)
            
set_pev(iEntpev_frame0.0)
            
g_flEntityFrame[id] = 0.0
            set_pev
(iEntpev_animtime0.0)
            
set_pev(iEntpev_framerate0.0)
            return
        }

        
pev(iEntpev_frameflFrame)
        if( 
flFrame 252.0 ) {
            
RemoveUserParachute(idiEnt)
            return
        }

        
flFrame += 2.0

        g_flEntityFrame
[id] = flFrame
        set_pev
(iEntpev_frameflFrame)

        return
    }

    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 15.0, -get_pcvar_float(g_pCvarFallSpeed))
            
fVecVelocity[2] = fVelocity_z
            set_pev
(idpev_velocityfVecVelocity)

            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)
    }

zmd94 is offline
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 01-11-2015 , 06:36   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #240

Seems it works, finally thanks
TheBladerX is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:34.


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