Update cl_lib.lua

Swapped out umsg for net library
This commit is contained in:
Zach P 2021-06-12 16:06:27 -07:00 committed by GitHub
parent afca346273
commit 1dca6d0a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,14 +48,15 @@ function ulx.blindUser( bool, amt )
end
end
local function rcvBlind( um )
local bool = um:ReadBool()
local amt = um:ReadShort()
ulx.blindUser( bool, amt )
end
usermessage.Hook( "ulx_blind", rcvBlind )
net.Receive( "ulx_blind", function( ln )
print("ADAD")
local bool = net.ReadBool()
local amt = net.ReadInt(16)
ulx.blindUser( bool, amt )
end )
local curVote
local function optionsDraw()
@ -83,10 +84,11 @@ local function optionsDraw()
draw.DrawText( title .. "\n\n" .. optiontxt, "Default", 20, ScrH()*0.4, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
end
local function rcvVote( um )
local title = um:ReadString()
local timeout = um:ReadShort()
local options = ULib.umsgRcv( um )
net.Receive( "ulx_vote", function( ln )
local title = net.ReadString()
local timeout = net.ReadInt(16)
local options = net.ReadTable()
local function callback( id )
if id == 0 then id = 10 end
@ -102,8 +104,8 @@ local function rcvVote( um )
LocalPlayer():AddPlayerOption( title, timeout, callback, optionsDraw )
curVote = { title=title, options=options, endtime=CurTime()+timeout }
end
usermessage.Hook( "ulx_vote", rcvVote )
end )
-- Any language stuff for ULX should go here...