|
AlliedModders Donor
|
11-17-2010
, 10:40
Re: Jetpack
|
#128
|
I have modifed the jetpack plugin again to have variable fuel consumption depending on class (for TF2 and DoD). I also added the rockettrail effect for TF2.
So now it is:
This plugin adds a 'jetpack' which allows players to fly around the map by binding a key to +jetpack.
CVARS:- sm_jetpack
- Enables/disables this plugin
- Default: "1"
- sm_jetpack_adminonly
- Only allows admins to have jetpacks?
- Default: "0"
- sm_jetpack_team
- team restriction (0=all use, 2 or 3 to only allowed specified team to have a jetpack
- Default: "0"
- sm_jetpack_onspawn
- Give players a jetpack when they spawn?
- Default: "1"
- sm_jetpack_announce
- This will enable announcements that jetpacks are available
- Default: "0"
- sm_jetpack_start_sound
- Jetpack start sound file
- Default: ""
- TF2 Default: "weapons/flame_thrower_airblast.wav"
- sm_jetpack_stop_sound
- Jetpack stop sound file
- Default: ""
- TF2 Default: "weapons/flame_thrower_end.wav"
- sm_jetpack_loop_sound
- Jetpack loop sound file
- Default: "vehicles/airboat/fan_blade_fullthrottle_loop1.wav"
- TF2 Default: "weapons/flame_thrower_loop.wav"
- sm_jetpack_empty_sound
- Jetpack empty sound file
- Default: "common/bugreporter_failed.wav"
- TF2 Default: "weapons/syringegun_reload_air2.wav"
- sm_jetpack_refuel_sound
- Jetpack refuel sound file
- Default: "hl1/fvox/activated.wav"
- sm_jetpack_volume
- Jetpack sound volume
- Default: "0.5"
- sm_jetpack_speed
- Jetpack speed
- Velocity.z that will be added each "jetpack frame"
- Default: "100"
- sm_jetpack_gravity
- Set to 1 to have gravity affect the jetpack (MOVETYPE_FLYGRAVITY), 0 for no gravity (MOVETYPE_FLY).
- Default: "1"
- sm_jetpack_fuel
- Jetpack fuel
- Amount of fuel to start with (-1 == unlimited)
- Default: "-1"
- sm_jetpack_max_refuels
- Number of times the jetpack can be refueled (-1 == unlimited)
- Default: "-1"
- sm_jetpack_refueling_time
- Amount of time to wait before refueling
- Default: "30.0"
TF2 CVARS:- sm_jetpack_noflag
- Prevent TF2 flag carrier from using the jetpack?
- Default: "1"
- sm_jetpack_rate_scout
- Rate at which the jetpack consumes fuel for scouts
- Default: "1"
- sm_jetpack_rate_sniper
- Rate at which the jetpack consumes fuel for snipers
- Default: "1"
- sm_jetpack_rate_soldier
- Rate at which the jetpack consumes fuel for soldiers
- Default: "1"
- sm_jetpack_rate_demo
- Rate at which the jetpack consumes fuel for demo men
- Default: "1"
- sm_jetpack_rate_medic
- Rate at which the jetpack consumes fuel for medics
- Default: "1"
- sm_jetpack_rate_heavy
- Rate at which the jetpack consumes fuel for heavys
- Default: "2"
- sm_jetpack_rate_pyro
- Rate at which the jetpack consumes fuel for pyros
- Default: "1"
- sm_jetpack_rate_spy
- Rate at which the jetpack consumes fuel for spys
- Default: "1"
- sm_jetpack_rate_engineer
- Rate at which the jetpack consumes fuel for engineers
- Default: "1"
DOD CVARS:- sm_jetpack_rate_rifleman
- Rate at which the jetpack consumes fuel for riflemen
- Default: "1"
- sm_jetpack_rate_assault
- Rate at which the jetpack consumes fuel for assault
- Default: "1"
- sm_jetpack_rate_support
- Rate at which the jetpack consumes fuel for support
- Default: "1"
- sm_jetpack_rate_sniper
- Rate at which the jetpack consumes fuel for snipers
- Default: "1"
- sm_jetpack_rate_mg_type
- Rate at which the jetpack consumes fuel for machine gunners
- Default: "2"
- sm_jetpack_rate_rocket
- Rate at which the jetpack consumes fuel for rocket men
- Default: "1"
OTHER MODS CVAR:- sm_jetpack_rate
- Rate at which the jetpack consumes fuel
- Default: "1"
Native Interface:
PHP Code:
/** * Assume control of the Jetpack plugin * * @param plugin_only Set to 1 to assume complete control of the jetpack. * @param announce Announce status changes to the player. * @return none */ native ControlJetpack(bool:plugin_only=true);
/** * Get the jetpack indicator of the player * * @param index Client index * @return true if the player has a jetpack */ native bool:HasJetpack(client);
/** * Returns if the player's jetpack is on * * @param index Client index * @return true if the player's jetpack is on */ native bool:IsJetpackOn(client);
/** * Get the jetpack fuel amount of the player * * @param index Client index * @return amount of fuel the jetpack has */ native GetJetpackFuel(client);
/** * Get the fuel consumption rate for the jetpack of the player * * @param index Client index * @return Rate at which the jetpack consumes fuel */ native GetJetpackRate(client);
/** * Get the refueling time for the jetpack of the player * * @param index Client index * @return Refueling time for the jetpack */ native Float:GetJetpackRefuelingTime(client);
/** * Set fuel for the jetpack of the player * * @param index Client index * @param fuel Amount of fuel for the jetpack (-1 == infinate) * @param refuels Number of times the jetpack can be refueled (-1 == infinate) * @return none */ native SetJetpackFuel(client, fuel=-1, refuels=-1);
/** * Set the fuel consumption rate for the jetpack of the player * * @param index Client index * @param rate Rate at which the jetpack consumes fuel (-1 == use class convars) * @return none */ native SetJetpackRate(client, rate=-1);
/** * Set the refueling time for the jetpack of the player * * @param index Client index * @param time Refueling time for the jetpack * @return none */ native SetJetpackRefuelingTime(client, Float:fuel);
/** * Give a jetpack to the player * * @param index Client index * @param fuel Amount of fuel for the jetpack (-1 == infinate) * @param refueling_time Refueling time for the jetpack * @param max_refuels Number of times the jetpack can be refueled (-1 == infinate) * @param rate Rate at which the jetpack consumes fuel (per game frame) * @param explode jetpack explodes on death if true * @param burn jetpack burns enemies if true * @return amount of fuel the jetpack has */ native GiveJetpack(client, fuel=-1, Float:refueling_time=0.0, max_refuels=-1, rate=-1, bool:explode=false, bool:burn=false);
/** * Take the jetpack from the player * * @param index Client index * @return none */ native TakeJetpack(client);
/** * Give jetpack fuel to the player * * @param index Client index * @param fuel Amount of fuel to add to the jetpack (-1 == infinate) * @param refuels Number of refuels to add to the jetpack (-1 == infinate) * @return amount of fuel the jetpack has */ native GiveJetpackFuel(client, fuel=-1, refuels=-1);
/** * Take fuel from the jetpack of the player * * @param index Client index * @param fuel Amount of fuel to remove from the jetpack (-1 == all) * @param refuels Number of refuels to remove from the jetpack (-1 == all) * @return amount of fuel the jetpack has */ native TakeJetpackFuel(client, fuel=-1, refuels=-1);
/** * Start the jetpack (bind to a keydown) * * @param index Client index * @return none */ native StartJetpack(client);
/** * Stop the jetpack (bind to a keyup) * * @param index Client index * @return none */ native StopJetpack(client);
/** * Gets called when the Jetpack is started * * @param client: The index of the client that used the jetpack. * @return Plugin_Stop will prevent the jetpack from starting. */ forward Action:OnJetpack(client);
/** * Gets called when a Jetpack burns someone * * @param victim: The index of the victim to be set fire * @param client: The index of the client that is using the jetpack * @param damage: The damage to be done to the victim, can be changed. * @return Plugin_Stop will prevent the jetpack from burning the victim. */ forward Action:OnJetpackBurn(victim, client, &damage);
/** * Gets called when a Jetpack explodes * * @param victim: The index of the victim of the explosion * @param client: The index of the client that exploded * @param damage: The damage to be done to the victim, can be changed. * @return Plugin_Stop will prevent the jetpack from injuring the victim. */ forward Action:OnJetpackExplode(victim, client, &damage);
Change log
1/3/2011 - v2.2
1/25/2011 - v2.3
- Fixed jetpacks persisting when using convars and sm_jetpack is enabled and then disabled.
- Fixed Fuel Rate getting set to 0, resulting in infinite fuel when using convars.
- Fixed invalid convar handle error when a player spawns and the class isn't set (is 0) in TF2, when using convars.
6/22/2012 - v3.0
- Added convars to allow/disallow jetpacks based on class
- Changed jetpack to be activate by holing down JUMP (spacebar), +jetpack can still be used.
- Added burn enemies and explode features to jetpack
- Added burn and explode parameters to GiveJetpack()
- Added a cookie to disable using +JUMP to activate the jetpack
- Change GetJetpack()'s rate rate to default to -1
- Change jetpack explode range and damage to vary depending on amount of remaining fuel.
- Changed jetpack to create a light entity in addition to the particle effects
- Added getref param to ztf2grabs's HasObject() native.
- Changed jetpack to not activate if the players MoveType == MOVETYPE_NONE
- Renamed GetJetpack() primitive to HasJetpack()
- Added IsJetpackOn() primitive to jetpack
- Fixed stand alone jetpack having no fuel instead of infinite fuel when sm_jetpack_fuel == -1
- Fixed bug in jetpack when using convars to set fuel, rate and enable/disable
- Fixed bug in jetpack when using convars to set enable/disable
- Don't allow jetpack while taunting, dazed, cloaked, dead ringered, heavy firing or sniper zoomed.
- Updated jetpack to use the ResourceManager
- Changed jetpack to actually use the sm_jetpack_stop_sound
- Added AUTO_DOWNLOAD to ResourceManger::SetupSound() to set download flag depending on if the file starts wit the name of one of the built in sound directories
- Changed jetpack, ubershield & hgrsource to precache sounds OnConfigsExecuted().
6/26/2012 - v3.1
- Fixed jetpack flames
- Added OnJetpackBurn() & OnJetpackExplode() forwards
- Added sm_jetpack_burn_range, sm_jetpack_burn_damage, sm_jetpack_explode_fuel,
- sm_jetpack_explode_range & sm_jetpack_explode_damage convars
- Renamed jetpack::SetMoveType() to SetMoveCollideType()
- Changed jetpack to check SourceCraft immunities before exploding or burning enemies
- Added damage parameter to OnJetpackBurn() & OnJetpackExplode()
- Changed CreateFlameAttack() to call DamagePlayer() (or HurtPlayer() if available)
- Changed jetpack to call ztf2grab::HasObject() to disallow players toting sentries and other buildings from using it.
- Fixed Property "m_bBurning" not found errors.
Last edited by naris; 06-26-2012 at 22:31.
|
|
|
|