Rp Server Job Help

Hi, i recently made a server of my own a few days ago, and it seems to be going pretty well, im mainly adding addons and stuff like the phx svn pc mod and stuff, but i needed help making a job.

I am wanting to make a Car dealer/salesman job on my server, but i have no idea were to begin, i knew someone that had it made for him, but i have no idea who to ask or were to begin, besides the forum here.

So… Can anyone help me in making a car dealer job for my new server?

ofcourse ud be payed for it though, incase anyones wondering

I may be able to help you. From a few hours from examining a drug dealer job code, I could fix something up for you.
You can edit this code any way you want, I’m just setting up the basics for you. Ok, assuming you’re using some type of dark rp, go to gamemodes/DarkRP/gamemode/shared.lua Open that up, and at the bottom where it says: //ADD TEAMS UNDER THIS LINE: add this:

TEAM_carsales = AddExtraTeam(“Car salesman”, Color(153,204,204,255), “models/player/male_04.mdl”, [[The car salesman sells cars to people who need them.]], {“keys”}, “carsales”, 2, 60, 0, false)//

Then when you’re done adding that and saving the file, open up addshipment.lua in the exact same folder. At the bottom where it says: – ADD CUSTOM SHIPMENTS HERE(next line): Add this code:

AddCustomShipment(“Car”, “WHERE THE JEEP IS”, “cars_jeep”, 2000, 1, true, 200, true, {TEAM_carsales})

Dont copy and paste the one above this text, because I’m currently to lazy to find out where the jeep is, so where it says in caps: “WHERE THE JEEP IS” Just put the directory the jeep or car is in. You can also edit that script, because it probably isn’t perfect. You would probably want it to look something like this:

EX- AddCustomShipment(“Car”, “models/nova/airboat_seat.mdl”, “cars_jeep”, 2000, 1, true, 200, true, {TEAM_carsales})

That would be a seat. So, just edit it for the jeep/airboat, whichever one. And sorry this is so long, takes me a while to explain myself.

P.S.–> Since you’re putting the car into a shipment, when you are carsalesman, in the f4 menu, you can spawn a box with a car in it. Im not sure if it is RP-like since a car in a box isn’t very realistic.

great thanks, but 1 more question… how would i restrict spawning cars though the q menu vehicals tab? I want the carsalesman to be the only one to possibly give access to cars

Well, the first way is in garrysmod\gamemodes\DarkRP\gamemode\init.lua, where you find where it says:

CfgVars[“adminsents”] = 1 --Should all SENTs be admin only?
CfgVars[“adminsweps”] = 1 --Should all sweps be admin only?

keep those on 1, but I’m not sure if those make it so vehicles are admin only, so then you could try one more thing, which is typing in your server’s console: sbox_maxvehicles 0
Then again, that might disallow the shipments of vehicles also, so try both, or just one, I don’t know. Maybe someone else could help you on that one also.

ok ill try them, again, thanks alot :open_mouth: how could i ever repay you lol

No need. These forums are a place for help. People don’t go asking for things when they answer a question. lol. If they did…Jesus would come back and eat tacos for eternity…Just a thought :stuck_out_tongue:

EDIT: Holy crap, I sound like a freakin’ rapist!

i probably wont be able to test this till tommarow or after work, but the only problem i see is, when the vehical is created out of the shipment… the owner will be shared, and everyone will be able to pick them up, how can i make them owned by the world?

Actually, if you have correctly installed DarkRP, when you see the vehicle, yes it might say the owner is shared, but I do believe they added the thing when you see the vehicle, you can click f2 to buy the car, so that only you can enter it and ride it.

EDIT: And, since the owner is shared, everyone will be able to use their physics gun to pick them up, even when you bought it. That I believe there are mods out there to protect them. And actually, I think Simple Prop Protection might be one of them, which comes with Dark RP, but I could be wrong. I’ve gotta check my sources. But, give it a try.

It didn’t work for me it just has the error: ERROR: GAMEMODE:‘PlayerInitialSpawn’ Failed: DarkRP\gamemode\player.lua:155: attempt to get length of global ‘RPExtraTeams’ (a nil value)
ERROR: GAMEMODE:‘PlayerSpawn’ Failed: DarkRP\gamemode\sv_gamemode_functions.lua:339: bad argument #1 to ‘pairs’ (table expected, got nil)

-snip-