DarkRP custom jobs to VIP rank

As in the name, i need help for making a job only for “VIP”, i’ve been searching and just found trolling…
So could anyone please give me the code im going to add to make jobs only for vip

also tell me where im going to add the TEAM_… or “job” so it only make that for vip

I do have the code, but its not very usefull, there are very much bugs. And you can’t make people vip, so only admins can do vip jobs.
Want it? add me on steam: gameplayer4noob (Don’t troll about it, i choosed it when i was 9)

You’re not much older as I see, since your English still as terrible.
Anyways, gamedude, there should be an easy way to assign the jobs to certain ranks, but you’ll have better luck at the LUA forums.

DarkRP has the ability to sign jobs to admins only built into it. No edits needed…

As for VIP there are a few edits needed.
I’d look at how the admin jobs are assigned, copy the process and make a meta:IsVip() function.


if ply:IsUserGroup("VIP")

Well, I’m naughty and use DarkRPVars, but they do there task.
Make a table in the same sql database called vips
1 column called steamID (primary key, although not that it matters. Make it unique as well)
DB.QueryValue() is the function used in DarkRP. I simply copied it, not sure if that’s something DarkRP unique or not though.

[lua]
local steamID = sql.SQLStr(ply:SteamID())
DB.QueryValue(“SELECT steamID FROM vips WHERE steamID = " …steamID…”;", function(cb)
if (cb) then
timer.Simple(1, function()
ply:SetDarkRPVar(“vip”, true)
end)
else
timer.Simple(1, function()
ply:SetDarkRPVar(“vip”, false)
end)
end
end)
[/lua]

Throw that in a PlayerAuthed hook then add this to a shared file:

[lua]
function _R.Player:IsVip()
if self.DarkRPVars and self.DarkRPVars.vip then
return true
else
return false
end
end
[/lua]

There, you now have a working ply:IsVip(), now you can use this in the same method as ply:IsAdmin().
Ofcourse, that’s the simple part to code. The annoying parts are making only certain jobs open to the VIP rank and allowing those ranks view the job / spawn specific entities etc. It’s not hard, just a bit tedious.

I’m not helping anymore, I already helped more than I normally would. If you want to run a server you should get to know the code inside DarkRP. There is no point running another clone that is just snippets from code found on facepunch. There is already a great server that does that, called ByB ;).

This is, in the end the all out more complex and clinically more tedious and pissy than need be BUT More stuctured and stable…