How to set what jobs sell? (DarkRP)

Post Reply
Mebes
New to forums
New to forums
Posts: 5
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Thu Apr 17, 2014 8:37 pm

How to set what jobs sell? (DarkRP)

Post by Mebes »

Does anyone know how to set what some jobs can sell? I want to make Drug Dealers and stuff that have custom stores to buy from. I checked the internet, but nothing shows up.
User avatar
Sir Nipah
This is my homepage
This is my homepage
Posts: 76
Joined: Mon Jul 08, 2013 3:38 am
Location: Australia/Melbourne
Contact:

Re: How to set what jobs sell? (DarkRP)

Post by Sir Nipah »

I'l have a little play on my local server for you. Keep in mind it's 6:30PM here, So I may be a 24 hours with a reply.
Image Garry's Mod veteran.
User avatar
Sir Nipah
This is my homepage
This is my homepage
Posts: 76
Joined: Mon Jul 08, 2013 3:38 am
Location: Australia/Melbourne
Contact:

Re: How to set what jobs sell? (DarkRP)

Post by Sir Nipah »

Ok Mebes, I had a little play and can now tell you a little on what your trying to do.
I'm assuming that you have a entity in mind? no..

1st thing you need to do is add the entity to the server. (I would be a good idea to read over some of the entities in there.)
./garrysmod/gamemodes/darkrp/entities/entities
Now that the entity/entities are uploaded we can move onto adding them to the job.
You will need to edit a file called "addentities.lua"...
./garrysmod/gamemodes/darkrp/gamemode/config/addentities.lua
You should find that this is the file responsible for the guns the "Gun Dealer" can sell. Take note of this..

Code: Select all

DarkRP.createEntity("Drug lab", {
	ent = "drug_lab",
	model = "models/props_lab/crematorcase.mdl",
	price = 400,
	max = 3,
	cmd = "buydruglab",
	allowed = {TEAM_GANG, TEAM_MOB}
})
I will tell you line by line whats going down.
  • On line 1, "DarkRP.createEntity" is telling darkrp that this is an entity and it's part of the gamemode. In quotation marks it reads "Drug lab". This is the title of the entity players will see.
  • On line 2, "ent" is responsible for getting the entity that you added to the "./darkrp/entities/entities" not to long ago.
    You add the name of your entities folder after the "=".
  • Line 3, "model" asking you for a model to represent the entity ingame.
  • Line 4 should be self explanatory
  • Line 5, "max" asking you how many of this entity, can one play have on the map at any given time.
  • Line 6 "cmd"... I can't tell you for 100% if I'm right here but, I believe that it is the command needed to spawn the thing
  • Line 7, "allowed" is asking for the name of the team that can access this entity.
    Use the team name not the job name. IE TEAM_MYJOB

    Code: Select all

    -- ./garrysmod/gamemodes/darkrp/gamemode/config/jobrelated.lua
    TEAM_MYJOB = DarkRP.createJob("My Job",
And that should do it. I have not tested this (I downloaded the gamemode and had a read of the code) so I can't say it will work. This seems to be all I can find in regards to a...
Mebes wrote:custom stores to buy from.
I'd love to hear if it works
It's Easter so, Happy Easter mate ^.^
Image Garry's Mod veteran.
User avatar
Sir Nipah
This is my homepage
This is my homepage
Posts: 76
Joined: Mon Jul 08, 2013 3:38 am
Location: Australia/Melbourne
Contact:

Re: How to set what jobs sell? (DarkRP)

Post by Sir Nipah »

The feels when you can't edit post to fix mistakes. ._.
Image Garry's Mod veteran.
Mebes
New to forums
New to forums
Posts: 5
Joined: Thu Apr 17, 2014 8:37 pm

Re: How to set what jobs sell? (DarkRP)

Post by Mebes »

Thanks for all the help, I really appreciate all the effort you went through! Once I finish my server, you are very welcome to join. Just message me if interested :D
Post Reply