View Single Post
Author Message
Senior Member
Join Date: Apr 2010
Old 07-24-2010 , 15:27   [L4D2] Jockey racing v1.0.8(+ 4 player mode)
Reply With Quote #1


This is a mod based on TF2silencer's idea

Initial Concept

The point of this plugin is to facilitate and allow admins to have jockey races on their servers, i do not recommend this being played in an all randoms game because its generally not gonna work out.

PHP Code:
// This file was auto-generated by SourceMod (v1.4.0-dev)
// ConVars for plugin "Jockey racing mod v1.0.6a (35).smx"

// Is Jockey racing on
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
Gamemode_jockey_racing "1"

// When a player gets biled & molo, how many seconds does it take for them to RECOVER
// -
// Default: "8"
// Minimum: "1.000000"
L4d2_Fire_slowdown_duration "8"

// Tell players about Jockey racing when they join? 
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
L4d2_Jockey_racing_broadcast "1"

// Amount of time that the adrenaline boost will last
// -
// Default: "12"
// Minimum: "1.000000"
L4d2_drug_boost_duration "12"

// Allow survivor to become faster with adrenaline
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
L4d2_drug_boost_on "1"

// How often do players get adrenaline to use?(seconds)
// -
// Default: "60"
// Minimum: "1.000000"
L4d2_how_often_adrenaline "60"

// How often do players get molos and vomitjars to use?(seconds)
// -
// Default: "40"
// Minimum: "1.000000"
L4d2_how_often_grenade "40"

// Should jockeys and humans be slower on their own after the race starts, recommended due to alot of teamless runners
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
L4d2_jockey_slowdown_enable "1"

// Number of seconds before a player CAN use the adrenaline
// -
// Default: "1.0"
// Minimum: "0.000000"
// Maximum: "10.000000"
L4d2_selfhelp_delay "1.0"

// How fast does the adrenaline bar fill (in seconds)
// -
// Default: "2.0"
// Minimum: "0.000000"
// Maximum: "10.000000"
L4d2_selfhelp_duration "2.0"

// When someone hangs off the edge they can take pick themselves back up, 0:Disable, 1:Enable  
// -
// Default: "1"
L4d2_selfhelp_edgegrab "1"

// Number of seconds before player gets told about the adrenaline boost
// -
// Default: "3.0"
// Minimum: "0.000000"
// Maximum: "10.000000"
L4d2_selfhelp_hintdelay "3.0"

//  Allow player to take adrenaline with a jockey on them , 0:disable, 1:adren,pills, 2:medkit, 3:both 
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "3.000000"
L4d2_selfhelp_ride "1"

//  Allow player to throw bile & molotovs at each other with a jockey on them , 0:disable, 1:enable
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_allow_grenade "1"

// How is player told that he can throw bile & molotovs (0 - disable, 1 - chat, 2 - hint)
// -
// Default: "2"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d_incapped_message_type "2"

// Kill any Human bots after 60 seconds of racestart(recommend for less than 8 players on versus) 
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_kill_bot_survivors "0"

// When someone gets incapd they can pick themselves up(usefull for players who have god off,future releases) , 0:disable, 1:Enable
// -
// Default: "1"
l4d_selfhelp_incap "1"

// Jockey racing plugin version.
// -
// Default: "1.0.6"
sm_Jockey_racing_version "1.0.6"

// RGB Value for coach. Usage: "R G B" or "-1 -1 -1" to do nothing.
// -
// Default: "0 0 0"
sm_l4d_painter_coach "0 0 0"

// RGB Value for ellis. Usage: "R G B" or "-1 -1 -1" to do nothing.( from gamemann's script)these values are NOT RECOMMENDED TO MODIFY unless you know what you are doing :)
// -
// Default: "255 242 0"
sm_l4d_painter_ellis "255 242 0"

// Enables painting zombies.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_l4d_painter_enabled "1"

// RGB Value for nick. Usage: "R G B" or "-1 -1 -1" to do nothing.
// -
// Default: "0 255 0"
sm_l4d_painter_nick "0 255 0"

// Render mode of colored people.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_l4d_painter_render_mode "0"

// RGB Value for bill. Usage: "R G B" or "-1 -1 -1" to do nothing.
// -
// Default: "255 0 0"
sm_l4d_painter_rochelle "255 0 0" 
Not all convars have been tested fully, if you see any not working as intended please let me know.

How to use
This is very straight forward, 8 players is recommend with at least 5 of them being friends or theres a high chance someone will try to ruin the game, this doesn't start automatically the admin needs to type "!raceon" and a 30 second countdown will start, players get teleported to the initial positions and colours are matched.
i may add a auto start but during some of my testing it didnt work out well for a few different reasons so i stuck to manual start.

Plugin in ACTION

Heres a video of the latest test with 8 players where you can see some of the features

Features of versus version
  • Take adrenaline whilst the jockey is on you
  • Throw bile and molotovs when jockied at other players
  • Cause specific effects to other players with molotov(slowdown),vomitjar(blind)
  • 12 seconds sprint time when adrenaline is taken(variable)
  • Players cant attack each other(prevents foul play)
  • scoring system eg. when a team reaches the safehouse they get a score and a time in which the round was completed.
  • If a jockey gets off a survivor they both move at half of the max speed(to prevent players running on their own).
  • Tanks get killed automatically to prevent jockeys becoming bots(this may change)
  • Each 2 players are assigned a colour and this helps the jockeys jump on the right person after ladders.
  • Doors and all events are forced to start at the beginning of each map(including finales)
  • Adrenaline is awarded depending on the players position on the race(needs improvement)
And theres a few more which can be seen during gameplay.

Features of 4 player version
  • Almost all of the above except for the throwing of molotovs and vomitjars
  • Added lasers from Ztar's lethal weapon plugin that allow jockeys to protect survivors against tanks
  • Gave all power to jockey eg, give adrenaline, pickup from ledge, laser, full control of survivor.

To use this plugin although its not a must i recommend using DieTeetasse's jockey jump plugin
i suggest you modify these cvar
"l4d2_jockeyjump_delay 1" on DieTeetasse .cfg as well as removing the sound effect(4 jockeys screaming at all times can be annoying :/)

I also recommend using HLDJ as a host to play racing songs (google it if you havent heard of it)

and also Thraka's infected release found here
These aren't a must but they are useful and make the game mode better.
The jockeys jump on my server seems to work about 80% of the time so if it doesn't work sometimes I recommend dismounting and mounting the survivor again.

This is my first plug-in and i never expected to end up with this many lines of code, so I expect that there's going to be a few problems here and there.
Also due to only being able to test the plugin fully once a week,odds are theres a few issues.
Please let me know of any problems you have and il try my best to fix them .
Also if you look through the code and see anything i could improve on i would appreciate your feedback.
The only maps currently working properly are DARK CARNIVAL, THE PARISH, HARD RAIN & SWAMP FEVER (dead center is completely useless in many ways for this, i don't think im going to add the passing for similar reasons to dead center)

Theres alot of stuff i still want to improve, but due to this being my first plugin i want to make sure the basics work before i add anything to it.
To fix:
The jockey killing system is only working at the moment with the full 8 players if theres 6 the jockeys wont be killed when everyone reaches the safehouse(fixed)
Remove pointless server console messages
clean up code
Turn alltalk on without typing !raceon everyround (any help on this would be great )(done)
Find a way to reduce gas canister's radius(molotov)
Add seperate mode for 4 players only(campaign type)(done ftw).
Add jockey rage mode(depending on user feedback)

Versus version history:
- release
- Fixed small error with adrenaline not working and added support for HARD RAIN
- Added support for Swamp fever, thanks for the warning fixes Dyzer
-Added new method of killing jockeys once everyone reaches saferoom, new method of removing SI, changed few cvars, removed the block on the Infected release(thanks Searcher64 ).
-Removed all spam when "!raceon" is typed, added new fix to prevent commons spawning, modified a few of the welcome messages and cleaned a bit of code up.
-modified the killing of jockeys when they reach the safehouse(not fully tested)
-Added convar(see convar list end) to kill survivor bots after 60 seconds of typing !raceon,hopefully improved the freezing system,players can now pick themselves up without a medikit(both from ledge and normal incap)
-Fixed random zombie spawn problems that specific people were having, added timer to keep adrenaline from being accumulated in a server,tweaked players slowdown and set convar l4d_kill_bot_survivors to 0 default.
-Removed all melee weapons, added ability to throw molotov and bile whilst jockeyd,Added door lock to stop players from closing the saferoom door on other players during the race),added convars and a few small tweaks. thanks to DJ_WEST for the molotov and bile code(couldn't have done this without it ).
-Added adrenaline supply depending on players position(great idea searcher, nightmare to do thow :/),removed boomer spawning, added a fully blind method for when a survivor gets biled.
Re-upped 1.0.7 as i forgot to uncomment a testing function :/.
-Fixed some minor problems with the adrenaline.
-Removed the old spawn method, added an automatic spawn at the start, added vote system to start the race, added a finale switch from atomic stryker's ai triggerfix.
Coop version history:
-Coop version released
-Added teleport for jockeys who jump on different colours or run too far away from their survivor, fixed a few issues also.
Thanks to Abaddown for letting me test on his server
TF2Silencer for the idea
Alot of the code was taken from other scripts here, if i have missed any one out please let me know.

Panxiaohai(for his self help plugin which helped give adrenaline to survivors whilst jockeyed )

Dusty1029(for the powerups plugin which increase the speed of the survivors)

krazykylep(for his scoring system "Racemod" which Hyster helped me work on(thanks hyster))

gamemann(for the l4d2 painter plugin used in the teams colouring)

DJ_WEST(for his incapped grenade code, which i had no chance of coming up with on my own :/)

All my friends at L4d2original that helped me test the plugin
also thanks to Dyzer and Absolute for answering my questions on the events.


Ive just released a seperate version for 4 players only, as ive found out everytime i wanted to play this i had to get 7 other people and that is a huge waste of time.
So if you prefer playing with just a few friends then i recommend the coop version.
A few features of that mode can be seen in this video, that was the only 4 player test i did with this version, but apart from small problems(which are now fixed) the gameplay was good.
I removed the bile jars and moly's that are found in versus and added a jockey laser which i got from ztar's cool plugin Lethal weapon, thanks to him for that.
The laser is fairly good and is only used to kill tanks, which appear about 90% of the time, because of this all finales are now playable(i may add zombies in concert HR finale, SF finale so jockeys can kill them as well as tanks).
I added also a vote system which is cast in the beginning of everyround so players can vote when their ready, as well as a few more things.I also took a small bit of code off Atomic Stryker's survivor ai triggerfix to force the finales to start, thanks.
I am adding the vote system in versus right now and will upload 1.0.8 very soon.

Also im not sure if im allowed to put two slightly different plugins under the same title, so if their is a problem with that please let me know Mods.
Attached Files
File Type: sp Get Plugin or Get Source (Jockey racing mod v1.0.8.sp - 1100 views - 170.9 KB)
File Type: sp Get Plugin or Get Source (Jockey racing mod COOP v1.0.1.sp - 914 views - 160.3 KB)

Last edited by Fleepster99; 08-17-2010 at 23:26. Reason: new version
Fleepster99 is offline