• [DarkRP] Using uTime in a Custom Check
    3 replies, posted
so, I have the following: [code] customCheck = function() if ply:GetUTimeTotalTime() >= 2 then end end [/code] My first question: I've seen "ply:GetUTimeTotalTime()" in other threads, now would this work? I have yet to confirm this. My second question: In what increments does it go in? I want 2 hours. I'm guessing seconds, but I want to make sure. My third question: Would I just leave it as it is? (Other than adding the "else" and the error message or whatever) Or would I return something? My LAST question: How would I refuse the job to the player? (what would I put in the "else" statement, other than the error message)
[code] customCheck = function(ply) return ply:GetUTimeTotalTime() >= 2000 // 2000 seconds - return ( have they played for more than 2000 seconds? ) end [/code]
1:Yes, it should 2:it's in seconds, so just do 2*60*60 3:Just return true I think, I'm not too familiar with darkrp or customchecks for it 4:probably just return false, see my response to number 3 [B]Edit:[/B] [QUOTE=Coffeee;49800727][code] customCheck = function(ply) return ply:GetUTimeTotalTime() >= 2000 // 2000 seconds end [/code][/QUOTE] Why in the world would anybody ever use 2000 seconds, that's barely more than half an hour, and a completely random number.
[QUOTE=Coffeee;49800727][code] customCheck = function(ply) return ply:GetUTimeTotalTime() >= 2000 // 2000 seconds - return ( have they played for more than 2000 seconds? ) end [/code][/QUOTE] so, would this work? [code] customCheck = function(ply) return ply:GetUTimeTotalTime() >= 2( 60 * 60 ) or ply:GetNWString("usergroup") == "sponsor" or ply:IsAdmin() end, CustomCheckFailMsg = "You must have at least two hours to play as this job!" [/code]
Sorry, you need to Log In to post a reply to this thread.