gmod lua get vbar visible -- This module holds any type of chatting functions CATEGORY_NAME = "Chat" ------------------------------ Psay ------------------------------ function ulx.psay( calling_ply, target_ply, message ) if calling_ply:GetNWBool( "ulx_muted", false ) then ULib.tsayError( calling_ply, "You are muted, and therefore cannot speak! Use asay for admin chat if urgent.", true ) return end ulx.fancyLog( { target_ply, calling_ply }, "#P to #P: " .. message, calling_ply, target_ply ) gmod lua get vbar visible How to get it for free? gmod lua get vbar visible end local psay = ulx.command( CATEGORY_NAME, "ulx psay", ulx.psay, "!p", true ) psay:addParam{ type=ULib.cmds.PlayerArg, target="!^", ULib.cmds.ignoreCanTarget } psay:addParam{ type=ULib.cmds.StringArg, hint="message", ULib.cmds.takeRestOfLine } psay:defaultAccess( ULib.ACCESS_ALL ) psay:help( "Send a private message to target." ) ------------------------------ Asay ------------------------------ local seeasayAccess = "ulx seeasay" if SERVER then ULib.ucl.registerAccess( seeasayAccess, ULib.ACCESS_OPERATOR, "Ability to see 'ulx asay'", "Other" ) end -- Give operators access to see asays echoes by default gmod lua get vbar visible How to dowload it? gmod lua get vbar visible function ulx.asay( calling_ply, message ) local format local me = "/me " if message:sub( 1, me:len() ) == me then format = "(ADMINS) *** #P #s" message = message:sub( me:len() + 1 ) else format = "#P to admins: #s" end gmod lua get vbar visible How to dowload it? gmod lua get vbar visible local players = player.GetAll() for i=#players, 1, -1 do local v = players[ i ] if not ULib.ucl.query( v, seeasayAccess ) and v ~= calling_ply then -- Calling player always gets to see the echo table.remove( players, i ) end end ulx.fancyLog( players, format, calling_ply, message ) gmod lua get vbar visible How to use it? gmod lua get vbar visible end local asay = ulx.command( CATEGORY_NAME, "ulx asay", ulx.asay, "@", true, true ) asay:addParam{ type=ULib.cmds.StringArg, hint="message", ULib.cmds.takeRestOfLine } asay:defaultAccess( ULib.ACCESS_ALL ) asay:help( "Send a message to currently connected admins." ) ------------------------------ Tsay ------------------------------ function ulx.tsay( calling_ply, message ) ULib.tsay( _, message ) gmod lua get vbar visible How to dowload it? gmod lua get vbar visible if ULib.toBool( GetConVarNumber( "ulx_logChat" ) ) then ulx.logString( string.format( "(tsay from %s) %s", calling_ply:IsValid() and calling_ply:Nick() or "Console", message ) ) end end local tsay = ulx.command( CATEGORY_NAME, "ulx tsay", ulx.tsay, "@@", true, true ) tsay:addParam{ type=ULib.cmds.StringArg, hint="message", ULib.cmds.takeRestOfLine } tsay:defaultAccess( ULib.ACCESS_ADMIN ) tsay:help( "Send a message to everyone in the chat box." ) ------------------------------ Csay ------------------------------ gmod lua get vbar visible How to get it for free? gmod lua get vbar visible function ulx.csay( calling_ply, message ) ULib.csay( _, message ) if ULib.toBool( GetConVarNumber( "ulx_logChat" ) ) then ulx.logString( string.format( "(csay from %s) %s", calling_ply:IsValid() and calling_ply:Nick() or "Console", message ) ) end end local csay = ulx.command( CATEGORY_NAME, "ulx csay", ulx.csay, "@@@", true, true ) csay:addParam{ type=ULib.cmds.StringArg, hint="message", ULib.cmds.takeRestOfLine } csay:defaultAccess( ULib.ACCESS_ADMIN ) gmod lua get vbar visible How to dowload it? gmod lua get vbar visible csay:help( "Send a message to everyone in the middle of their screen." ) ------------------------------ Thetime ------------------------------ local waittime = 60 local lasttimeusage = -waittime function ulx.thetime( calling_ply ) if lasttimeusage + waittime > CurTime() then ULib.tsayError( calling_ply, "I just told you what time it is! Please wait " .. waittime .. " seconds before using this command again", true ) return end gmod lua get vbar visible How to get it? gmod lua get vbar visible lasttimeusage = CurTime() ulx.fancyLog( "The time is now #s.", os.date( "%I:%M %p") ) end local thetime = ulx.command( CATEGORY_NAME, "ulx thetime", ulx.thetime, "!thetime" ) thetime:defaultAccess( ULib.ACCESS_ALL ) thetime:help( "Shows you the server time." ) ------------------------------ Adverts ------------------------------ gmod lua get vbar visible How to get it for free? gmod lua get vbar visible ulx.adverts = ulx.adverts or {} local adverts = ulx.adverts -- For XGUI, too lazy to change all refs local function doAdvert( group, id ) if adverts[ group ][ id ] == nil then if adverts[ group ].removed_last then adverts[ group ].removed_last = nil id = 1 else gmod lua get vbar visible How to get it for free? gmod lua get vbar visible id = #adverts[ group ] end end local info = adverts[ group ][ id ] local message = string.gsub( info.message, "%%curmap%%", game.GetMap() ) message = string.gsub( message, "%%host%%", GetConVarString( "hostname" ) ) message = string.gsub( message, "%%ulx_version%%", ULib.pluginVersionStr( "ULX" ) ) gmod lua get vbar visible How to get it for free? gmod lua get vbar visible if not info.len then -- tsay local lines = ULib.explode( "\\n", message ) for i, line in ipairs( lines ) do local trimmed = line:Trim() if trimmed:len() > 0 then ULib.tsayColor( _, true, info.color, trimmed ) -- Delaying runs one message every frame (to ensure correct order) end end else gmod lua get vbar visible How to use it? gmod lua get vbar visible ULib.csay( _, message, info.color, info.len ) end ULib.queueFunctionCall( function() local nextid = math.fmod( id, #adverts[ group ] ) + 1 timer.Remove( "ULXAdvert" .. type( group ) .. group ) timer.Create( "ULXAdvert" .. type( group ) .. group, adverts[ group ][ nextid ].rpt, 1, function() doAdvert( group, nextid ) end ) end ) end gmod lua get vbar visible How to use it? gmod lua get vbar visible -- Whether or not it's a csay is determined by whether there's a value specified in "len" function ulx.addAdvert( message, rpt, group, color, len ) local t if group then t = adverts[ tostring( group ) ] if not t then t = {} adverts[ tostring( group ) ] = t end gmod lua get vbar visible How to get it? gmod lua get vbar visible else group = table.insert( adverts, {} ) t = adverts[ group ] end local id = table.insert( t, { message=message, rpt=rpt, color=color, len=len } ) if not timer.Exists( "ULXAdvert" .. type( group ) .. group ) then timer.Create( "ULXAdvert" .. type( group ) .. group, rpt, 1, function() doAdvert( group, id ) end ) end gmod lua get vbar visible PasteShr gmod lua get vbar visible end ------------------------------ Gimp ------------------------------ ulx.gimpSays = ulx.gimpSays or {} -- Holds gimp says local gimpSays = ulx.gimpSays -- For XGUI, too lazy to change all refs local ID_GIMP = 1 local ID_MUTE = 2 function ulx.addGimpSay( say ) table.insert( gimpSays, say ) gmod lua get vbar visible How to get it for free? gmod lua get vbar visible end function ulx.clearGimpSays() table.Empty( gimpSays ) end function ulx.gimp( calling_ply, target_plys, should_ungimp ) for i=1, #target_plys do local v = target_plys[ i ] if should_ungimp then gmod lua get vbar visible PasteShr gmod lua get vbar visible v.gimp = nil else v.gimp = ID_GIMP end v:SetNWBool("ulx_gimped", not should_ungimp) end if not should_ungimp then ulx.fancyLogAdmin( calling_ply, "#A gimped #T", target_plys ) else gmod lua get vbar visible How to get it for free? gmod lua get vbar visible ulx.fancyLogAdmin( calling_ply, "#A ungimped #T", target_plys ) end end local gimp = ulx.command( CATEGORY_NAME, "ulx gimp", ulx.gimp, "!gimp" ) gimp:addParam{ type=ULib.cmds.PlayersArg } gimp:addParam{ type=ULib.cmds.BoolArg, invisible=true } gimp:defaultAccess( ULib.ACCESS_ADMIN ) gimp:help( "Gimps target(s) so they are unable to chat normally." ) gimp:setOpposite( "ulx ungimp", {_, _, true}, "!ungimp" ) gmod lua get vbar visible How to use it? gmod lua get vbar visible ------------------------------ Mute ------------------------------ function ulx.mute( calling_ply, target_plys, should_unmute ) for i=1, #target_plys do local v = target_plys[ i ] if should_unmute then v.gimp = nil else v.gimp = ID_MUTE end v:SetNWBool("ulx_muted", not should_unmute) gmod lua get vbar visible How to use it? gmod lua get vbar visible end if not should_unmute then ulx.fancyLogAdmin( calling_ply, "#A muted #T", target_plys ) else ulx.fancyLogAdmin( calling_ply, "#A unmuted #T", target_plys ) end end local mute = ulx.command( CATEGORY_NAME, "ulx mute", ulx.mute, "!mute" ) mute:addParam{ type=ULib.cmds.PlayersArg } gmod lua get vbar visible How to get it? gmod lua get vbar visible mute:addParam{ type=ULib.cmds.BoolArg, invisible=true } mute:defaultAccess( ULib.ACCESS_ADMIN ) mute:help( "Mutes target(s) so they are unable to chat." ) mute:setOpposite( "ulx unmute", {_, _, true}, "!unmute" ) if SERVER then local function gimpCheck( ply, strText ) if ply.gimp == ID_MUTE then return "" end if ply.gimp == ID_GIMP then if #gimpSays < 1 then return nil end gmod lua get vbar visible How to dowload it? gmod lua get vbar visible return gimpSays[ math.random( #gimpSays ) ] end end hook.Add( "PlayerSay", "ULXGimpCheck", gimpCheck, HOOK_LOW ) end ------------------------------ Gag ------------------------------ function ulx.gag( calling_ply, target_plys, should_ungag ) local players = player.GetAll() for i=1, #target_plys do gmod lua get vbar visible How to get it? gmod lua get vbar visible local v = target_plys[ i ] v.ulx_gagged = not should_ungag v:SetNWBool("ulx_gagged", v.ulx_gagged) end if not should_ungag then ulx.fancyLogAdmin( calling_ply, "#A gagged #T", target_plys ) else ulx.fancyLogAdmin( calling_ply, "#A ungagged #T", target_plys ) end gmod lua get vbar visible How to get it? gmod lua get vbar visible end local gag = ulx.command( CATEGORY_NAME, "ulx gag", ulx.gag, "!gag" ) gag:addParam{ type=ULib.cmds.PlayersArg } gag:addParam{ type=ULib.cmds.BoolArg, invisible=true } gag:defaultAccess( ULib.ACCESS_ADMIN ) gag:help( "Gag target(s), disables microphone." ) gag:setOpposite( "ulx ungag", {_, _, true}, "!ungag" ) local function gagHook( listener, talker ) if talker.ulx_gagged then gmod lua get vbar visible How to dowload it? gmod lua get vbar visible return false end end hook.Add( "PlayerCanHearPlayersVoice", "ULXGag", gagHook ) -- Anti-spam stuff if SERVER then local chattime_cvar = ulx.convar( "chattime", "1.5", "