Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - feldma

Pages: [1]
1
I'm creating a "ForceMOTD" command, however I do not want players to be able to close it instantly.

I looked at the motdmenu.lua file (or whatever it's called), however I'm not sure if copying the file would work.

If I changed
Code: [Select]
local isUrl
local url

function ulx.showMotdMenu( steamid )
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( "ULX MOTD" )
window:SetVisible( true )
window:MakePopup()

local html = vgui.Create( "DHTML", window )
--html:SetAllowLua( true ) -- Too much of a security risk for us to enable. Feel free to uncomment if you know what you're doing.

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 )
if not isUrl then
html:SetHTML( ULib.fileRead( "data/ulx_motd.txt" ) or "" )
else
url = string.gsub( url, "%%curmap%%", game.GetMap() )
url = string.gsub( url, "%%steamid%%", steamid )
html:OpenURL( url )
end
end
to
Code: [Select]
local isUrl
local url

function ulx.showMotdMenu( steamid )
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( "ULX MOTD" )
window:SetVisible( true )
window:MakePopup()

local html = vgui.Create( "DHTML", window )
--html:SetAllowLua( true ) -- Too much of a security risk for us to enable. Feel free to uncomment if you know what you're doing.
       
        timer.Simple(60, function()
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 )
        end)

html:SetSize( window:GetWide() - 20, window:GetTall() - button:GetTall() - 50 )
html:SetPos( 10, 30 )
if not isUrl then
html:SetHTML( ULib.fileRead( "data/ulx_motd.txt" ) or "" )
else
url = string.gsub( url, "%%curmap%%", game.GetMap() )
url = string.gsub( url, "%%steamid%%", steamid )
html:OpenURL( url )
end
end

Would that work?
I'm not talking about the function name, just wondering if the motd would actually appear + would the timer on the close button work.

Thanks. I would test but at school.

EDIT: Just realised, even if I called this, it would open on the calling player. How would I make it open on the target_ply?

2
Developers Corner / A few questions about ULX commands...
« on: February 15, 2016, 02:25:23 AM »
Hi all.

I'm working on stuff and I need to know if a few things are possible:

Firstly, is it possible to restrict a ULX command to once every, let's say, TTT round?

And is it possible to have a command that saves (such as "every round do this", but you can override that with a different command)?

I know this will require a fair amount of coding, but yeah, if anyone could point me in the right direction (if it's even possible).

Chances are I'll need to create an entirely new addon for this, no doubt.

Thanks,
Feldma.

3
General Chat & Help and Support / Bug: FAdmin breaks "Inherits from..."
« on: February 05, 2016, 12:32:43 PM »
The bug is that FAdmin will break the "Inherits from" option, so whenever you change it to anything other then user, it will just default back to user.

I've tried making jobs while FAdmin is disabled, and it works. However, when I turn FAdmin back on, it resets everything to user again.
I would prefer to leave FAdmin enabled, so I guess I'm going to be configuring every rank I have manually.

If anyone has a solution (other then to disable FAdmin, that would be appreciated.)

My ULib/ULX versions (run "ulx version" in console):
ULib v.. 2.52d
ULX v.. 3.62d


Game mode(s) I am having this problem on:
DarkRP

Lua errors shown in console, if any:
No errors are being shown in console.

Thank you,
Feldma.

4
General Chat & Help and Support / Quick ULX help.
« on: November 09, 2014, 12:11:47 PM »
Hey,

I was just wondering how you would let a specific group add users to a specific group.

as far as I know, this is what I should be typing in console: ulx groupallow Moderator "ulx adduser" "%user %regular"

However, it doesn't seem to work.

Thanks!

Pages: [1]