Hm, are you sure it's actually creating the window?
I've never edited anything major in this part of ulx, so I can only be of small help.
One thought I had whilst trying to debug this was that since this is in modules/sh instead of modules/cl (where motdmenu.lua is), there might be something going wonky when it tries to create the DFrame, etc. Not sure how to fix this though, maybe add another script with the function in it, drop that in modules/cl, and have this script execute it?
I'll try that.
Edit: new code:
function ulx.donate( ply )
ply:SendLua([[
local isUrl --everything from here to 'end' is pretty much ripped straight from motdmenu.lua
local url
local window = vgui.Create( "DFrame" )
if ScrW() > 640 then -- Make it larger if we can.
window:SetSize( ScrW()*0.9, ScrH()*0.9 )
else
window:SetSize( 640, 480 )
end
window:Center()
window:SetTitle( "Donate to the Server!" )
window:SetVisible( true )
window:SetDraggable( false )
window:ShowCloseButton( false )
window:MakePopup()
local html = vgui.Create( "HTML", window )
local button = vgui.Create( "DButton", window )
button:SetText( "Close" )
button.DoClick = function() window:Close() end
button:SetSize( 100, 40 )
button:SetPos( (window:GetWide() - button:GetWide()) / 2, window:GetTall() - button:GetTall() - 10 )
html:SetSize( window:GetWide() - 20, window:GetTall() - button:GetTall() - 50 )
html:SetPos( 10, 30 )
html:OpenURL( "https://sq10.net/don8/" )
]])
end
local donate = ulx.command( CATEGORY_NAME, "ulx donate", ulx.donate, "!donate" )
donate:defaultAccess( ULib.ACCESS_ALL )
donate:help( "Donate $10 for VIP commands and access to pointshop!" )
It gives me this error (through the server console, not locally) when I type '!donate' in chat:
DLL_MessageEnd: Refusing to send user message LuaCmd of 256 bytes to client, user message size limit is 255 bytes
The actual filesize is 1,252 bytes, according to filezilla.