ULX

Author Topic: Restricting DarkRP Jobs using UTime  (Read 3007 times)

0 Members and 1 Guest are viewing this topic.

Offline Elektro

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Restricting DarkRP Jobs using UTime
« on: May 25, 2021, 11:07:53 AM »
Hi, I need help with using UTime (i'm not a very experimented LUA user).

I want to restrict a job until you have "x" hours in the server.

For example, people who want to be Police need to have 2 hours playing.

Offline jakej78b

  • Newbie
  • *
  • Posts: 26
  • Karma: 4
Re: Restricting DarkRP Jobs using UTime
« Reply #1 on: May 30, 2021, 05:01:57 PM »
Code: [Select]
local x = 3 -- time in hours
CustomCheckFailMsg = function(ply) return ply:GetUTimeTotalTime() < x * 60 * 60 end

Add this into your job and it will make it so only people who have played for x hours can become the job.
« Last Edit: May 30, 2021, 05:18:06 PM by jakej78b »