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

Subplugin Submission [ZP5.0] & [ZP 4.3] Addon: Parachute


Post New Thread Reply   
 
Thread Tools Display Modes
Joker93270
Member
Join Date: Sep 2012
Old 09-22-2012 , 11:43   Re: [ZP5.0] Addon: Parachute
Reply With Quote #21

Quote:
Originally Posted by gogicaa View Post
Whats wrong with this ?!
Plugin downloads fine for me...
Hey,

I have a error:

http://www.amxmodx.org/plcompiler_vb.cgi?file_id=102567
Joker93270 is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 09-22-2012 , 12:31   Re: [ZP5.0] Addon: Parachute
Reply With Quote #22

Quote:
Originally Posted by Joker93270 View Post
[HOWTO] Compile locally with custom includes

Off/ I will update this plugin soon.
__________________

Last edited by H.RED.ZONE; 09-22-2012 at 12:31.
H.RED.ZONE is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 09-23-2012 , 09:22   Re: [ZP5.0] & [ZP 4.3] Addon: Parachute
Reply With Quote #23

Updated.

Code:
Version 1.4
* No PreThink.
* Code Rewriten.
* Only necessary things are left.
* Lower CPU usage.
* Can be used in [ZP5.0] And [ZP4.3]
* Only FakeMeta Used.
* Fixed Animation Bug.
__________________
H.RED.ZONE is offline
Joker93270
Member
Join Date: Sep 2012
Old 09-27-2012 , 13:09   Re: [ZP5.0] & [ZP 4.3] Addon: Parachute
Reply With Quote #24

Big thanx bro'
Joker93270 is offline
anantthakor
Senior Member
Join Date: Aug 2009
Old 10-04-2012 , 00:03   Re: [ZP5.0] & [ZP 4.3] Addon: Parachute
Reply With Quote #25

Awsome ! Thanks...
anantthakor is offline
ESPADONGAMING
Senior Member
Join Date: Mar 2011
Location: In the Game [ro]
Old 10-08-2012 , 20:46   Re: [ZP5.0] & [ZP 4.3] Addon: Parachute
Reply With Quote #26

with engine
PHP Code:
#include <amxmodx>
#include <engine>

#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_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_event("ResetHUD""CBasePlayer_Spawn_Post""be")
    
register_event("DeathMsg""CBasePlayer_Killed_Post""a")
}

public 
plugin_precache() {
    
precache_model(PARACHUTE_MODEL)
}

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

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

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

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

RemoveUserParachute(idiEnt) {
    
remove_entity(iEnt)
    
g_iUserParachute[id] = 0
}

CreateParachute(id) {
    static 
iszInfoTarget
    
if( !iszInfoTarget ) {
        
iszInfoTarget create_entity("info_target")
    }

    new 
iEnt create_entity("iszInfoTarget")
    if( 
iEnt 0) {
        static 
iszClass 0
        
if( !iszClass ) {
            
iszClass create_entity(PARACHUTE_CLASS)
        }
        
entity_set_string(iEntEV_SZ_classname"iszClass")
        
entity_set_edict(iEntEV_ENT_aimentid)
        
entity_set_edict(iEntEV_ENT_ownerid)
        
entity_set_int(iEntEV_INT_movetypeMOVETYPE_FOLLOW)

        
entity_set_model(iEntPARACHUTE_MODEL)

        
entity_set_int(iEntEV_INT_sequencedeploy)
        
entity_set_int(iEntEV_INT_gaitsequence1)
        
entity_set_float(iEntEV_FL_frame0.0)
        
g_flEntityFrame[id] = 0.0
        g_iUserParachute
[id] = iEnt
        MarkUserHasParachute
(id)
        
        return 
iEnt
    
}
    return 
0
}

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

    new 
Float:flFrame
    
new iEnt g_iUserParachute[id]
    
    new 
Float:fallspeed get_pcvar_float(g_pCvarFallSpeed) * -1.0
    
    
new button get_user_button(id)
    new 
oldbutton get_user_oldbutton(id)
    new 
flags get_entity_flags(id)

    if(
iEnt && (flags FL_ONGROUND)) {

        if( 
entity_get_int(iEntEV_INT_sequence) != detach ) {
            
entity_set_int(iEntEV_INT_sequencedetach)
            
entity_set_int(iEntEV_INT_gaitsequence1)
            
entity_set_float(iEntEV_FL_frame0.0)
            
g_flEntityFrame[id] = 0.0
            entity_set_float
(iEntEV_FL_animtime0.0)
            
entity_set_float(iEntEV_FL_framerate0.0)
            return
        }

        
flFrame entity_get_float(iEntEV_FL_fuser1) + 2.0

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

        
flFrame += 2.0

        g_flEntityFrame
[id] = flFrame
        entity_set_float
(iEntEV_FL_frameflFrame)    

        return
    }

    if(
button IN_USE) {
        new 
Float:fVecVelocity[3]
        
entity_get_vector(idEV_VEC_velocityfVecVelocity)

        if( 
fVecVelocity[2] < 0.0 ) {
            if(
iEnt <= 0) {
                
iEnt CreateParachute(id)
            }
            
            
fVecVelocity[2] = (fVecVelocity[2] + 40.0 fallspeed) ? fVecVelocity[2] + 40.0 fallspeed
            entity_set_vector
(idEV_VEC_velocityfVecVelocity)

            if( 
entity_get_int(iEntEV_INT_sequence) == deploy ) {
                
flFrame g_flEntityFrame[id]++

                if( 
flFrame 100.0 ) {
                    
entity_set_float(iEntEV_FL_animtime0.0)
                    
entity_set_float(iEntEV_FL_framerate0.4)
                    
entity_set_int(iEntEV_INT_sequenceidle)
                    
entity_set_int(iEntEV_INT_gaitsequence1)
                    
entity_set_float(iEntEV_FL_frame0.0)
                    
g_flEntityFrame[id] = 0.0
                
}
                else {
                    
entity_set_float(iEntEV_FL_frameflFrame)
                }
            }
        }
        else if(
iEnt 0) {
            
RemoveUserParachute(idiEnt)
        }
    }
    else if( 
iEnt && (oldbutton IN_USE)) {
        
RemoveUserParachute(idiEnt)
    }

__________________
Skype: cristi.c94
SteamID: cristic_1994
ESPADONGAMING is offline
Send a message via MSN to ESPADONGAMING Send a message via Yahoo to ESPADONGAMING Send a message via Skype™ to ESPADONGAMING
FearyDust
Member
Join Date: Aug 2012
Old 12-15-2012 , 21:29   Re: [ZP5.0] & [ZP 4.3] Addon: Parachute
Reply With Quote #27

How to make the parachute fall faster, it's too slow ?

Last edited by FearyDust; 12-17-2012 at 03:18.
FearyDust is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 12-20-2012 , 02:03   Re: [ZP5.0] & [ZP 4.3] Addon: Parachute
Reply With Quote #28

Change this:

g_pCvarFallSpeed = register_cvar("parachute_fallspeed", "30")

to

g_pCvarFallSpeed = register_cvar("parachute_fallspeed", "100")
wicho is offline
alter
Member
Join Date: Jan 2013
Location: Lithuainia
Old 01-21-2013 , 08:49   Re: [ZP5.0] & [ZP 4.3] Addon: Parachute
Reply With Quote #29

Remake this to extra item please.
alter is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 01-21-2013 , 13:11   Re: [ZP5.0] & [ZP 4.3] Addon: Parachute
Reply With Quote #30

Quote:
Originally Posted by alter View Post
Remake this to extra item please.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#include <zp50_items>
#include <zp50_class_survivor>
#include <zp50_class_nemesis>

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

#define _NAME              "Parachute"
#define _COST                  20

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
}

new 
_pcvar_enable_plugin
    
,_pcvar_enable_human
    
,_pcvar_enable_zombie
    
,_pcvar_allow_survivor
    
,_pcvar_allow_nemesis

new _gItemID
    
public plugin_init() {
    
register_plugin(_PLUGIN_VERSION_AUTHOR)

    
g_pCvarFallSpeed register_cvar("parachute_fallspeed""30")

    
_gItemID zp_items_register(_NAME_COST)
    
    
register_forwardFM_CmdStart"fw_Start" )
    
    
_pcvar_enable_plugin register_cvar("zp_parachute_enabled""1")
    
_pcvar_enable_human register_cvar("zp_parachute_human""1")
    
_pcvar_enable_zombie register_cvar("zp_parachute_zombie""0")
    
_pcvar_allow_survivor register_cvar("zp_parachute_survivor""1")
    
_pcvar_allow_nemesis register_cvar("zp_parachute_nemesis""0")
    
    
RegisterHam(Ham_Spawn"player""Ham_CBasePlayer_Spawn_Post"1)
    
RegisterHam(Ham_Killed"player""Ham_CBasePlayer_Killed_Post"1)
}

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

public 
zp_fw_items_select_post(id_itemidignorecost) {
    if (
_itemid == _gItemID) {
        if(
is_user_alive(id)) {
            
MarkUserHasParachute(id)
        }
    }
    return 
ZP_ITEM_AVAILABLE;


public 
zp_fw_items_select_pre(iditemid) {
    if (
itemid == _gItemID) {
        if (
get_pcvar_num(_pcvar_enable_plugin) == 0)
            return 
ZP_ITEM_DONT_SHOW;
            
        if (
get_pcvar_num(_pcvar_enable_human) == && !zp_core_is_zombie(id))
            return 
ZP_ITEM_DONT_SHOW;
        
        if (
get_pcvar_num(_pcvar_enable_zombie) == && zp_core_is_zombie(id))
            return 
ZP_ITEM_DONT_SHOW;    
            
        if (
get_pcvar_num(_pcvar_allow_survivor) == && zp_class_survivor_get(id))
            return 
ZP_ITEM_DONT_SHOW;
            
        if (
get_pcvar_num(_pcvar_allow_nemesis) == && zp_class_nemesis_get(id))
            return 
ZP_ITEM_DONT_SHOW;
        
        return 
ZP_ITEM_AVAILABLE;
    }
    return 
ZP_ITEM_AVAILABLE;
}

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

public 
Ham_CBasePlayer_Spawn_Post(id) {
    if( 
is_user_alive(id) ) {
        if( 
HasUserParachute(id) ) {
            new 
iEnt g_iUserParachute[id]
            if( 
iEnt ) {
                
RemoveUserParachute(idiEnt)
            }
        }
    }
}

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

__________________
H.RED.ZONE is offline
Reply


Thread Tools
Display Modes

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 03:58.


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