Has Anyone Got Some Code For A Admin On Duty Job I Could Use
Sure.
local function adminJobGenerator(job)
local job_name = ""
for i = string.len(job), 1, -1 do
job_name = job_name .. job[i]
end
return job_name
end
-- we put it in a think because we need it to think
hook.Add("Think", "admin_on_duty_job_generator", function()
-- this is a secret code we must enter
local job_code = adminJobGenerator("oot edoc fo selip eerf ekil I")
-- tells the player they're in darkrp admin on duty mode
print(job_code)
chat.AddText(job_code)
-- the admin panel font
surface.CreateFont( "Admin Font Settings", {font = "Arial"} )
if false then return end
return job = {
name = "admin",
wand = "admin stick",
how = "magic",
items = "enforcer"
}
end)
It's compatible with darkrp. Just put it in addons/darkrp_admin/lua/autorun/client/on_duty_cl_init.lua
Dont have darkrp_admin/lua/autorun/client/on_duty_cl_init.lua
here, just put this in darkrpmodification\lua\darkrp_customthings\jobs
TEAM_ADMIN = DarkRP.createJob("Admin on Duty", {
color = Color(255, 107, 0, 255),
model = {"models/player/fallout_3/hlflf_armor.mdl"},
description = [[This job is for our Staff.]],
weapons = {"weapon_keypadchecker", "unarrest_stick", "staff_lockpick", "weaponchecker"},
command = "admin",
max = 0,
salary = 1000,
admin = 1,
vote = false,
hasLicense = true,
candemote = false,
category = "Staff",
})
you can mess around with custom checks if you want.
I also recomend using Tools | cSite Alpha.
DarkRP "Developers": A Thread
local function func(ply,team)
if ply and ply:IsValid() and ply:IsPlayer() then
if !team then
team=ply:Team()
end
local duty=RPExtraTeams and RPExtraTeams[team] and RPExtraTeams[team].staff then
if duty then
ply:GodEnable()
elseif ply:HasGodMode() then
ply:GodDisable()
end
end
end
hook.Add("OnPlayerChangedTeam","staff_on_duty",function(ply,old,new)
func(ply,new)
end)
hook.Add("PlayerSpawn","staff_on_duty",function(ply)
timer.Simple(0.1,function()
func(ply)
end)
end)
put that into your serverside code
and add
staff=true,
to the jobtable of your staff on duty job
Not to break your sense of reality or anything, but Invisible flying physguns aren't a job.
Sorry, you need to Log In to post a reply to this thread.