So, my problem is. The menu wont show on f2 which it is set to ( see line 49 ) There are no errors at All. Anyone got an idea of why this isnt showing?
[lua]AddCSLuaFile ("VIPoints_Menu.lua")
AddCSLuaFile ("Shared.lua")
AddCSLuaFile ("VIPoints_System.lua")
include ("shared.lua")
include ("VIPoints_System.lua.lua")
function VIPointsMenu()
local Menu = vgui.Create( "DFrame" )
Menu:SetPos( ScrW() / 2 - 400, ScrH() / 2 - 400 )
Menu:SetSize( 800, 700 )
Menu:SetText( "VIPoints Menu" )
Menu:SetDraggable( false )
Menu:ShowCloseButton( true )
Menu:MakePopup()
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( VIPointsMenu )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 400, 760 )
local Trails = vgui.Create( "DPanelList" )
Trails:SetPos(0, 0)
Trails:SetPadding(2)
Trails:SetSpacing(2)
Trails:EnableVerticalScrollbar( true )
Trails:SizeToContents()
if TrialsList then
for k, v in pairs(TrailsList) do
local Trial = vgui.Create( "SpawnIcon" )
Trial:SetToolTip( "Cost:" ..v.Cost.. )
Trial.DoClick = function ()
if !ClickSpam then ClickSpam = CurTime() - 1 end
if ClickSpam > CurTime () then return end
ClickSpam = CurTime () + 0.5
RunConsoleCommand("PurchaseTrail", k)
end
end
end
end
end
usermessage.Hook( "VIPointsMenu", VIPointsMenu )
function VIPointsMenu ( ply )
umsg.Start( "VIPointsMenu", ply )
umsg.End()
end
hook.Add("ShowTeam", "MyHook", VIPointsMenu )
concommand.Add("PurchaseTrail", Purchase Trail )
[/lua]
ShowTeam is a serverside hook. That code is clientside.
[QUOTE=Jamie932;25197039]ShowTeam is a serverside hook. That code is clientside.[/QUOTE]
[lua]if ( SERVER ) then
function VIPointsMenu ( ply )
umsg.Start( "VIPointsMenu", ply )
umsg.End()
hook.Add("ShowTeam", "MyHook", VIPointsMenu )
end
concommand.Add("PurchaseTrail", Purchase Trail )[/lua]
Fixes it then I suppose?
No - You need to move that bit of code to a serverside file, such as init.lua.
[QUOTE=Jamie932;25197279]No - You need to move that bit of code to a serverside file, such as init.lua.[/QUOTE]
I put it into a Serverside File. And still not working. No errors.
Like I said there's no errors. I just fixed that spelling error with PurchaseTrial. Also, tell me what isnt being ended?
Sorry, you need to Log In to post a reply to this thread.