Jump to content

Real Time in MTA


3B00DG4MER

Recommended Posts

Hi,Today I've made a Admin Panel (For my server with MySQL)

I've stopped working at a problem (Ban System)

i can't get the time after 10 mins or 1 hour or 10 days or 1 year

Here's my code I've tried

  
    local time = guiGetText(ban.edit[2]) -- Mins 
    local realtime = getRealTime() 
    local timestamp = realtime.timestamp 
date = timestamp + time 
  

Link to comment

something like this :|

local time = guiGetText(ban.edit[2]) -- Mins 
    local realtime = getRealTime() 
    local timestamp = realtime.timestamp 
    if time*60000 < 60 then 
        date = timestamp + time*60000 
    elseif time*3600000 < 24 and time*3600000 > 1 then 
        date = timestamp + time*3600000 
    elseif time*86400000 < 30 and time*86400000 > 1 then 
        date = timestamp + time*86400000 
    end 

not sure if will works..

Link to comment
something like this :|
local time = guiGetText(ban.edit[2]) -- Mins 
    local realtime = getRealTime() 
    local timestamp = realtime.timestamp 
    if time*60000 < 60 then 
        date = timestamp + time*60000 
    elseif time*3600000 < 24 and time*3600000 > 1 then 
        date = timestamp + time*3600000 
    elseif time*86400000 < 30 and time*86400000 > 1 then 
        date = timestamp + time*86400000 
    end 

not sure if will works..

Thanks i'll try it later :wink:

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...