DarkRP:Vehicles

From GMod Wiki

Jump to: navigation, search
Deletion.pngThis page has been nominated for deletion. Deletion is due within approximately 30 days from nomination, unless the deletion has been disputed on the talk page. See more pages nominated for deletion here.
Reason for deletion: Not what Garry wants the wiki to be used for
Last Edit was made on 11/16/2011


NOTE: This feature is only available in DarkRP 2.3.7 or later!

You add vehicles for jobs to sell. You do this at the bottom of DarkRP/gamemode/addentities.lua, the same place you do your custom shipments.

How to add your own:

Firstly, install your custom vehicle pack (if your using one), then go in-game and type rp_getvehicles. It should print a list of vehicles into your console. Choose the vehicle your going to use, find it's corresponding rp_getvehicles name, and write it down or remember it.

 
AddCustomVehicle(<One of the vehicles from the rp_getvehicles list>, <Model of the vehicle>, <Price of the vehicle>, <OPTIONAL jobs that can buy the vehicle>)
 

How to find the model:

- If it's a custom vehicle, find the addons folder where the vehicle is and look in the /models folder, you want the name of the .mdl file for the vehicle you want.

- If it's a custom vehicle, go in-game and go into the q menu and the browse section, click on "Garry's Mod" and see if the vehicle appears there, if so right click and click 'Copy path to clipboard', then paste it in your code. If it doesn't appear when you click "Garry's Mod", try the subfolders until you find it.

- If it's a default vehicle, like the jeep or the jalopy, you can usually find their models by searching in the q menu in-game, however they're listed here too:

   "models/buggy.mdl" = Half Life 2 Jeep
   "models/airboat.mdl" = Half Life 2 Airboat
   "models/vehicle.mdl" = Half Life 2: Episode 2 Car

Here's an example:

 
AddCustomVehicle("Airboat", "models/airboat.mdl", 600, {TEAM_GUN, TEAM_MEDIC})
 

In this example it allows TEAM_GUN and TEAM_MEDIC to buy an airboat for $600.

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox