TTT motd day tabs

Post Reply
kArp
New to forums
New to forums
Posts: 9
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sun Sep 08, 2013 10:11 am

TTT motd day tabs

Post by kArp »

This is what I use currently

Code: Select all

<!DOCTYPE html>
<html>
<body style="margin:0px;padding:0px;overflow:hidden">

<iframe src="http://awolgamingttt.enjin.com/forum/m/16863137/viewthread/8662507-awol-gaming-l-trouble-in-terrorist-town-rules" frameborder="0" style="overflow:hidden; overflow-x:hidden; overflow-y:hidden; height:100%; width:100%; position:absolute; top:0px; left:0px; right:0px; bottom:0px" height="100%" width="100%">
  <p>Your browser does not support iframes.</p>
</iframe>

</body>
What I want to do is have a tab for donate, and rules
Trooper
A semi-regular
A semi-regular
Posts: 16
Joined: Fri Jun 14, 2013 4:19 pm

Re: TTT motd day tabs

Post by Trooper »

So easy mate, this is w hat you need to do. Your using ULX? Because this works for ULX, you also need a bit of lua experience for this to work. follow this path in the ULX Files


ulx/lua/ulx/modules/cl/motdmenu.lua

That is the file you need to edit in order to add more buttons like Donation and Forum Button.

How to start.

this is how you add a simple button onto your derma Window

Code: Select all

 

local html = vgui.Create( "HTML", window) -- this is given already in  the MOTD derma config but if --you are making something from scratch good idea to add it and localize it.

local don = vgui.Create( "DButton", window ) -- what that does is localize that DON means Create ----button and it is apart of the Derma window  named as window

don:SetText( "Donation Button" ) 
don:Size( 50, 100 ) 
-- the don:Size sets the length of the button and the height of the actual button no were to move it.
SetPose( ( window:GetWide() - don:GetWide()) /2, window:GetTall() - don:GetTall:GetTall() - 10 )
-- what SetPose does is simply sets the position of the button on your derma window.
don.DoClick = function() 
html:OpenURL( " the link of your Donation page on your forums goes here!" ) 
end
don:SetParent( window ) -- when you close the main derma page the button will close as well.



that is how you create a simple button. you can do alot more as well but I gave you the simple findings of how to make one. enjoy.
Post Reply