Jobs after a certain time

Is there any possible way that i can create a job which you just can use after a certain amount of time?
for example: Someone just joined my server for the firts time and instantly tries to be a cop but you need to play like 15 hour to become a cop

Add a time custom check to the job. This will require you to have Clocky or UTime.

I have UTime.
Can you say me which command i have to use for that custom check?

Player:GetUTime()

I am not that good in coding…do i just need to put it under the job like:

TEAM_POLICE = DarkRP.createJob(“Civil Protection”, {
color = Color(25, 25, 170, 255),
model = {“models/player/police.mdl”, “models/player/police_fem.mdl”},
description = [[…]],
weapons = {“arrest_stick”, “unarrest_stick”, “weapon_glock2”, “stunstick”, “door_ram”, “weaponchecker”},
command = “cp”,
max = 4,
salary = GAMEMODE.Config.normalsalary * 1.45,
admin = 0,
vote = true,
hasLicense = true,
ammo = {
[“pistol”] = 60,
},
category = “Civil Protection”,
** Player:GetUTime(time you need to play on the server/ lets say 2 hours)**
})

???

http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields

customCheck = function(ply) return (ply:GetUTime()/60/60) == 10 end,

(not sure if this will work untested)
(10 hours before they can join job)

Also it looks like you are editing the core files involving jobs (make sure you copy and pasted the job to the darkrpmodification job file)

not working for me :confused:

Post your job code in


 tags.

What do you mean with that?

Last time i’ve tried it i made it like this:
TEAM_POLICE = DarkRP.createJob(“Civil Protection”, {
color = Color(25, 25, 170, 255),
model = {“models/player/police.mdl”, “models/player/police_fem.mdl”},
description = [[…]],
weapons = {“arrest_stick”, “unarrest_stick”, “weapon_glock2”, “stunstick”, “door_ram”, “weaponchecker”},
command = “cp”,
max = 4,
salary = GAMEMODE.Config.normalsalary * 1.45,
admin = 0,
vote = true,
hasLicense = true,
customCheck = function(ply) return (ply:GetUTime()/60/60) == 10 end,
ammo = {
[“pistol”] = 60,
},
category = “Civil Protection”,
})

is there anything wrong?



TEAM_POLICE = DarkRP.createJob("Civil Protection", {
color = Color(25, 25, 170, 255),
model = {"models/player/police.mdl", "models/player/police_fem.mdl"},
description = [[...........]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "stunstick", "door_ram", "weaponchecker"},
command = "cp",
max = 4,
salary = GAMEMODE.Config.normalsalary * 1.45,
admin = 0,
vote = true,
hasLicense = true,
customCheck = function(ply) return (ply:GetUTime()/60/60) == 10 end,
ammo = {
["pistol"] = 60,
},
category = "Civil Protection",
})


post errors, “its not working” tells us nothing i see nothing wrong with that job just looking at it

there is no error showing up…it just doesn’t work…i have spent more than 20 hours on the server so it should normaly work…also if i try to set myself to team civil protection it just puts me into the job citizen

did you look all the way back, things like darkrp jobs dont just “not work” there is an error at some point

i found something…i have missed to place a “,” at one point (but it didn’t show up in the console)… thanks a lot
it does work now but i still have a question.
if the timer is set to 10 hours but someone has player only 7 hours, the job doesn’t show up at the job menu.
is there any way i can make it visible?

http://wiki.darkrp.com/index.php/Donator_Job_configuration

[editline]16th September 2015[/editline]

read that entire page, if its not on there then read through your config for darkrp its in there somewhere



customCheck = function(ply) return CLIENT or (ply:GetUTime()/60/60) == 10 end,


That will allow everyone to see the job.