Cron + table

VIPList = {}

cron.RegisterJob( “unvip”, function( sid )
v:SetUserGroup( “user” )
PrintMessage( HUD_PRINTTALK, v:Name()…"'s VIP has expired and revoked." )
end )

local function addVIP( ply, text )
local sep = string.Explode( " “, text )
if sep[1] == (”!ad" or “!add” or “!addv” or “!addvi”)
draw.SimpleText( “!addvip <name> <# of months>”, “Trebuchet20”, 130, ScrH()*0.827, Color(0,0,0,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
if sep[1] == “!addvip” and ply:IsUserGroup( “owner” ) then
local months = tonumber( sep[3] )
if not months then return ply:PrintMessage( HUD_PRINTTALK, “Invalid amount of months.” ) end

    local name = table.concat( sep, " ", 2 )
    for k,v in pairs( player.GetAll() ) do
        if v:Name():lower():find( name:lower() ) then
            v:SetUserGroup( "VIP" )

            local t = "*t" )
            local conf = {
                Minutes = t.min,
                Hours = t.hour,
                Days =,
                Months = (t.month%12 + months)

            cron.Add( "unvip_" .. v:SteamID(), conf, "unvip", v:SteamID() )
			table.insert( VIPList, { VIPname = v:Name(), VIPSteamID = v:SteamID(), VIPTime = months, --VIPTimeLeft = 
                            } )
            PrintMessage( HUD_PRINTTALK, ply:Name() .. " made player ".. v:Name() .. " a VIP for "..months.." months." )

hook.Add ( “PlayerSay”, “addVIP”, addVIP )

Hokay, so… So many threads I have made for this, but it will go a long way when all my questions are answered. By the way, I appreciate all the replies and answers! :slight_smile:

Down to business. First of all, I hope I’ve done this correctly, if not, don’t hesitate to correct! Anyways, I got this table that I want to insert so I can make a list of VIPs and shit. But the thing is, I need help finding out how long the cron has left… Anyone got any ideas?

EDIT: Oh, and also I made a “DListView” and I want to make a new line for each VIP. I’m trying to add a line with the information “Name, SteamID, Amount of Months Issued, Time Left” for each VIP. How would I go about doing this? Use this:

local DermaListView = vgui.Create(“DListView”)
DermaListView:SetPos(25, 50)
DermaListView:SetSize(450, 625)
DermaListView:AddColumn(“Amount of Months”)
DermaListView:AddColumn(“Time Left”)