Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local VIP_ENABLED = true
- local DONATE_URL = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4LGM7Q6LB43DQ"
- function ulx.vip( calling_ply )
- if not VIP_ENABLED then return calling_ply:PrintMessage( HUD_PRINTTALK, "Buying VIP is currently disabled... check back another time." ) end
- umsg.Start( "VIPDonate", calling_ply ) umsg.End()
- end
- local vip = ulx.command( "Utility", "ulx vip", ulx.vip, "!vip" )
- vip:defaultAccess( ULib.ACCESS_ALL )
- vip:help( "Opens the donation menu" )
- usermessage.Hook( "VIPDonate", function( um )
- local DermaPanel = vgui.Create( "DFrame" )
- DermaPanel:SetPos( 50, 50 )
- DermaPanel:SetSize( 300, 225 )
- DermaPanel:Center()
- DermaPanel:SetTitle( "VIP Donation Menu" )
- DermaPanel:SetVisible( true )
- DermaPanel:SetDraggable( true )
- DermaPanel:ShowCloseButton( true )
- DermaPanel:MakePopup()
- local DermaListView = vgui.Create("DListView")
- DermaListView:SetParent( DermaPanel )
- DermaListView:SetPos( 25, 50 )
- DermaListView:SetSize( 250, 150 )
- DermaListView:SetMultiSelect( false )
- local Nick = DermaListView:AddColumn( "Name" )
- Nick:SetMinWidth( 128 )
- Nick:SetMinWidth( 128 )
- DermaListView:AddColumn( "Is VIP" )
- DermaListView:AddColumn( "Friend" )
- for _, v in pairs( player.GetAll() ) do
- if v:CheckGroup( "moderator" ) or v:IsAdmin() then continue end -- moderator and up get VIP default.
- local IsVIP = "No"
- if v:IsVIP() then IsVIP = "Yes" end
- local IsFriend = "No"
- if v:GetFriendStatus() == "friend" then IsFriend = "Yes" end
- local Line = DermaListView:AddLine( v:Nick(), IsVIP, IsFriend )
- Line.IsVIP = v:IsVIP()
- Line.SteamID = v:SteamID()
- end
- local function DonateFor( SteamID )
- if not SteamID or SteamID == "NULL" then return end
- gui.OpenURL( DONATE_URL .. "&custom=" .. SteamID )
- LocalPlayer():PrintMessage( HUD_PRINTTALK, "When you donate, it takes around 1-2 minutes for it to process your donation to add you to VIP, once done it'll notice you in chatbox." )
- LocalPlayer():PrintMessage( HUD_PRINTTALK, "You won't see a notification when you extend your VIP time, you can re-open this menu to check if your VIP expire date has changed." )
- DermaPanel:Close()
- end
- local function OpenMenu( Info, Line )
- local Panel = Info:GetLine( Line )
- if Panel then
- local Nick = Panel:GetValue( 1 )
- local IsVIP = Panel.IsVIP
- local SteamID = Panel.SteamID
- local Popup = DermaMenu()
- if IsVIP then
- if SteamID == LocalPlayer():SteamID() then
- Popup:AddOption( "Extend your VIP by two months", function() DonateFor( SteamID ) end )
- else
- Popup:AddOption( "Extend " .. Nick .. "'s VIP by two months", function() DonateFor( SteamID ) end )
- end
- else
- if SteamID == LocalPlayer():SteamID() then
- Popup:AddOption( "Buy VIP for yourself", function() DonateFor( SteamID ) end )
- else
- Popup:AddOption( "Buy VIP for " .. Nick, function() DonateFor( SteamID ) end )
- end
- end
- Popup:Open()
- end
- end
- DermaListView.OnRowSelected = OpenMenu
- DermaListView.OnRowRightClick = OpenMenu
- end )
Advertisement
Add Comment
Please, Sign In to add comment