View Single Post
Author Message
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 08-11-2010 , 17:22   [CSS/HL2DM] Vehicle Mod
Reply With Quote #1

Requires SourceMod 1.4 or later and SDK Hooks

Description
Please read the whole post. if you can't be bothered to read the post, i can't be bothered to help you.

Lets you drive land/water vehicles like in the hl2 games.

Linux Crashes
Thanks to daftmink for mentioning a patched vphysics.so here which should fix crashes, thanks to the author of the patch aswell. you will have to replace it after updates as the original is restored. i have mentioned it to valve devs on the steam forums a couple of times but nothing has been done about it ...

if you have a steam forum account leave a post here maybe valve will do something if enough people complain.

Server Command
-- vehiclemod_spawnatuserid <userid> <vehicle name> <skin>[optional]

this command spawns a vehicle where the player is standing and forces them inside. you can grab a players userid by typing "status" in your console.
e.g vehiclemod_spawnatuserid 2 buggy 0

-- vehiclemod_spawnatcoords <x coord> <y coord> <z coord> <yaw angle> <vehicle name> <skin>[optional]

this spawns a vehicle at the given coords facing the given angle.
e.g vehiclemod_spawnatcoords 100.0 200.0 50.0 90.0 airboat

-- airboat and buggy are included in the zip file.

-- for both commands the vehicle name parameter is the name you store in the vehiclelist.cfg file which is located in cfg folder inside your gamefolder.

-- for both commands the skin parameter is for vehicles with multiple skins and is an integer. if your vehicle has 2 skins then you would access them with values of 0 or 1. the buggy and airboat don't have any extra skins.

-- you can use these command inside your own plugins or cfg files.

ConVars
vehiclemod_breakable -- min 0 max 1 --whether or not the vehicles can be destroyed (default 0).
vehiclemod_health -- min 1 max 10000 health of the vehicle when they are destroyable (default 200).
vehiclemod_autolock -- min 0 max 1 -- blocks player exiting once they enter (default 0).
vehiclemod_damagedriver -- min 0 max 1 -- lets the driver take damage while in the vehicle. crashing the vehicle into things damages the player if they're going fast, only area effect entities can damage players e.g explosions, triggers etc (default 1).
vehiclemod_gun_enable -- min 0 max 1 -- 0 disables vehicle guns 1 enables vehicle guns (default 0).
vehiclemod_gun_mindamage -- min 1 max 1000000 -- minimum damage the gun does (default 5).
vehiclemod_gun_maxdamage -- min 1 max 1000000 -- maximum damage the gun does (default 10).
vehiclemod_gun_rof -- min 0.01 max 100 -- the guns rate of fire, delays between shots in seconds (default 0.2).

Guns
Write the gun coordinates in the cfg file(see the buggy/airboat for example). these coordinates are relative to the vehicle origin, if you're unsure what values to use try the jeep/airboat values and tweak them until the gun is where you want it to be. the min and max damage cvars are linked so you can't have a lower value for max damage than min damage or higher value for min damage than max damage, the damage is chosen at random between those 2 values.

Installation
Place the compiled plugin in your sourcemod plugins folder and vehiclelist.cfg inside your cfg folder within the root game folder (not inside the sourcemod folder). place the files inside the zip file linked at bottom of this post into their relative folders.

Getting Sounds To Work
Go to your scripts folder within you game folder and open "game_sounds_manifest.txt" and add the line

Code:
"preload_file"  "scripts/game_sounds_vehicles.txt"
inside the curly brackets. take note that the file will most likely be overwritten when your game updates so be prepared to add it again if it does.

Notes
-- I have little time because of work and other responsibilities so please be patient.
-- Vehicles with enter hitboxes will not allow players to auto enter on spawn, the vehicle will land on top of them hurting or killing them.
-- At the moment when a player exits a vehicle their weapon viewmodel will be invisible, still looking for a way to fix it.
-- Players exit vehicle at different places depending on if they're blocked. this is the order off the exit points relative to the vehicle: left, right, front, back then top, if they're all blocked players can't exit at all.
-- Anti flip isn't 100% accurate.
-- If you kill an enemy by crushing them against an entity you won't be rewarded the kill because it counts as world damage. The same goes for team killing.
-- Vehicle crosshair isn't 100% accurate thanks to client side view smoothing.

Changelog

0.6 beta
-- Please re download all files including the cfg and vehicle files.
-- Added guns and related cvars, see above.
-- Fixed gun viewmodel not showing on vehicle exit.
-- Partial fix for laggy view.
-- Fix for vehicle controlling all player view (untested).
-- Changed the cfg file to accomodate guns, also added a section for the number of skins the model, if you don't choose a skin when spawning a vehicle a random one will be chosen.

0.5 beta
-- Please re download all files including the cfg and vehicle files.
-- Switched back to prop_vehicle_driveable from prop_vehicle, unfortunately this means laggy view.
-- Tried to fix vehicles controlling players views at earliest possible time (Untested).
-- Added some code i hope will make the vehicle work in tf2/dods this time round (Untested).
-- Added a new cvar for allowing players to take damage while in vehicle.
-- Added the airboat and added a new key in the vehicle database for land/water vehicle type.
-- Fixed bug with players leaving the server when they were in a vehicle.
-- All vehicles in the cfg are precached at map start
-- Made the skin parameter on the vehicle spawn commands optional.
-- Players can no longer destroy vehicles their team mates are in.
-- Fixed players not spawning in the correct place at round start if they were in a vehicle last round.
-- Players get rewarded kills for running over other players instead of them counting as a suicide.

0.4 beta

-- Switched from prop_vehicle_driveable to prop_vehicle and added my own control code.
-- No need for virtual offsets.
-- Should work in all games this time round.
-- Added anti flip code so vehicle should never flip upside down.
-- No laggy view or vehicle controlling all players views.
-- Added a check to make sure the spawn coordinates are clear.

0.3 beta
-- Added custom vehicle support, check out the revised server command.
-- Added vehicle database to zip containing gamedata.
-- Added new server command for spawning vehicles at coords instead of in front of players.

0.2 beta
-- Added cvars to make vehicles destroyable and set their health.
-- Added cvar to autolock vehicles once players enter. this is for anyone who wants to make a race mod.
-- Added a work around for vehicles controlling all players views when someone enters it.
-- Added a temporary fix for the laggy view. thanks to rcarm.
-- Modified the vehicle script with orangebox features so it should work in all games, please redownload the file. thanks to rcarm.
-- Added zombie master to gamedata and put the file in a separate zip file.

0.1 beta
-- Initial release.

link to vehicle files here. thanks to knifelemon.
Attached Files
File Type: cfg vehiclelist.cfg (688 Bytes, 1458 views)
File Type: sp Get Plugin or Get Source (vehiclemod.sp - 1759 views - 36.1 KB)
File Type: smx vehiclemod.smx (19.7 KB, 1367 views)
File Type: zip AzuiSleet-vphysics_oct.zip (907.1 KB, 1069 views)

Last edited by blodia; 01-15-2014 at 13:52.
blodia is offline