Can somebody look over this and make sure it will work?

[lua]
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)
end
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 = os.date( "*t" )
            local conf = {
                Minutes = t.min,
                Hours = t.hour,
                Days = t.day,
                Months = (t.month%12 + months)
            }

            cron.Add( "vip_" .. v:SteamID(), conf, "unvip", v:SteamID() )
			local newvip = {}
			newvip[ "name" ] = v:GetName()
			newvip[ "steamID" ] = v:SteamID()
			newvip[ "months" ] = months
			newvip[ "timeLeft" ] = ""
			table.insert( VIPList, newvip )

            PrintMessage( HUD_PRINTTALK, ply:Name() .. " made player ".. v:Name() .. " a VIP for "..months.." months." )
            break
        end
    end

elseif sep[1] == "!vipmenu" and ply:IsUserGroup( "owner" ) then
	RunConsoleCommand( "vip_menu" )

elseif sep[1] == "!removevip" and ply:IsUserGroup( "owner" ) then
	local name = table.concat( sep, " ", 2 )
	for k,v in pairs( player.GetAll() ) do
        if v:Name():lower():find( name:lower() ) then
			v:SetUserGroup( "user" )
			PrintMessage( HUD_PRINTTALK, v:Name().."'s VIP has been revoked forcefully." )
		end
	end
end

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

function VIPMenu()
local DermaPanel = vgui.Create( “DFrame” )
DermaPanel:SetPos( 50,50 )
DermaPanel:SetSize( 500, 700 )
DermaPanel:SetTitle( “V.I.P. Menu” )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()

local DermaListView = vgui.Create( "DListView", DermaPanel )
DermaListView:SetPos(25, 50)
DermaListView:SetSize(450, 625)
DermaListView:SetMultiSelect(false)
DermaListView:AddColumn( "Name" ) -- Add column
DermaListView:AddColumn( "SteamID" )
DermaListView:AddColumn( "Time Issued" )
DermaListView:AddColumn( "Time Left [ N/A ]" )

for k,v in pairs( VIPList ) do
	DermaListView:AddLine( v.Name, v.SteamID, months, "" )
end

local button = vgui.Create("DButton", DermaPanel)
button:SetTitle("Remove")
button:SetPos() -- Your pos
button:SetSize( 50, 20 ) -- Your size
button.DoClick = function(btn)
	local id = DermaListView:GetSelectedLine() -- Getting the line id
	VIPList[id].name:SetUserGroup( "user" )
	PrintMessage( HUD_PRINTTALK, VIPList[id].name.."'s VIP has been revoked forcefully." )
	cron.Remove( "vip_"..VIPList[id].steamID ) -- supposed to remove the cron by the special id of "vip_" and the player's SteamID
	DermaListView:RemoveLine( id )
	
end	

end
concommand.Add( “vip_menu”, VIPMenu )
[/lua]

Why don’t you just do what everyone does and test it a few times first? I thought part of being a coder was being able to check your own scripts and debug them, and only as a last resort ask the internet…

Well… It’s kinda impossible to try this without a server as it requires another player + My ports are closed …
But I have looked over it, fixed a problem, etc. I just wanted another’s opinion to see if I did it right.

Open them?

[lua]cron.RegisterJob( “unvip”, function( sid )
v:SetUserGroup( “user” )
PrintMessage( HUD_PRINTTALK, v:Name()…"'s VIP has expired and revoked." )
end )[/lua] will never work because you are trying to use a variable called v, which isn’t defined in that function or above.

@zzaacckk, Can’t…
@leiftiger But it is called when the cron ends, I thought that woulda worked…

[lua]
cron.Add( “vip_” … v:SteamID(), conf, “unvip”, v:SteamID() )
[/lua]

If not, then how could I do it?

What is cron?

A better version of timer. Using seconds minutes hours days months etc.

That saves over sessions