Compare commits

...

13 Commits

Author SHA1 Message Date
edshot99
b8bae34837 Revert "allow solo players to be able to change the map"
This reverts commit 5162e48a31.
2024-11-29 02:02:41 -06:00
edshot99
d490d8cbaa Revert "improve map voting with lower player count dealing with afk'ers"
This reverts commit e8725048bc.
2024-11-29 02:02:34 -06:00
edshot99
02ecd19a48 Revert "ksh script to download and generate map icons for some maps"
This reverts commit 76110bdbaa.
2024-11-29 01:48:12 -06:00
edshot99
e8725048bc improve map voting with lower player count dealing with afk'ers 2024-11-27 22:41:51 -06:00
edshot99
9a2c96fc81 format uptime properly 2024-08-20 01:48:13 -05:00
edshot99
3ba3c8ce0e add support for line breaks and server uptime in welcome message
more specifically: %n% and %uptime%
2024-08-18 23:35:41 -05:00
edshot99
4fd0013c4d ... and fix it for other changelevel functions too 2024-05-17 03:21:42 -05:00
edshot99
c020b9437d fix map not changing when the map file name uses spaces 2024-04-05 07:37:53 -05:00
edshot99
76110bdbaa ksh script to download and generate map icons for some maps 2024-03-25 03:13:41 -05:00
edshot99
5162e48a31 allow solo players to be able to change the map 2024-03-25 02:35:30 -05:00
edshot99
611419e837 fix map icons for maps that dont use the maps/thumb/ folder 2024-03-25 02:30:11 -05:00
edshot99
d4981eefa9 let users be able to votemap without instant map change and a heads up 2024-03-25 02:18:11 -05:00
edshot99
fc73984f95 add multiple chat listeners for ulx psay (!psay and !pm) 2024-03-25 02:16:55 -05:00
5 changed files with 20 additions and 6 deletions

View File

@ -10,7 +10,7 @@ function ulx.psay( calling_ply, target_ply, message )
ulx.fancyLog( { target_ply, calling_ply }, "#P to #P: " .. message, calling_ply, target_ply )
end
local psay = ulx.command( CATEGORY_NAME, "ulx psay", ulx.psay, "!p", true )
local psay = ulx.command( CATEGORY_NAME, "ulx psay", ulx.psay, {"!p", "!pm", "!psay"}, 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 )
@ -308,9 +308,14 @@ local function showWelcome( ply )
local message = GetConVarString( "ulx_welcomemessage" )
if not message or message == "" then return end
local uptimetbl = string.FormattedTime( SysTime() )
local uptime = string.format( "%02iH %02iM", uptimetbl.h, uptimetbl.m )
message = string.gsub( message, "%%curmap%%", game.GetMap() )
message = string.gsub( message, "%%host%%", GetConVarString( "hostname" ) )
message = string.gsub( message, "%%ulx_version%%", ULib.pluginVersionStr( "ULX" ) )
message = string.gsub( message, "%%n%%", "\n" )
message = string.gsub( message, "%%uptime%%", uptime )
ply:ChatPrint( message ) -- We're not using tsay because ULib might not be loaded yet. (client side)
end

View File

@ -53,7 +53,7 @@ function ulx.map( calling_ply, map, gamemode )
if gamemode and gamemode ~= "" then
game.ConsoleCommand( "gamemode " .. gamemode .. "\n" )
end
game.ConsoleCommand( "changelevel " .. map .. "\n" )
game.ConsoleCommand( "changelevel \"" .. map .. "\"\n" )
end
local map = ulx.command( CATEGORY_NAME, "ulx map", ulx.map, "!map" )
map:addParam{ type=ULib.cmds.StringArg, completes=ulx.maps, hint="map", error="invalid map \"%s\" specified", ULib.cmds.restrictToCompletes }

View File

@ -167,7 +167,7 @@ local function voteMapDone2( t, changeTo, ply )
end
if shouldChange then
ULib.consoleCommand( "changelevel " .. changeTo .. "\n" )
ULib.consoleCommand( "changelevel \"" .. changeTo .. "\"\n" )
end
end

View File

@ -46,6 +46,7 @@ function ulx.votemapVeto( calling_ply )
end
timer.Remove( "ULXVotemap" )
timer.Remove( "ULXVotemapNotice" )
ulx.timedVeto = nil
hook.Call( ulx.HOOK_VETO )
ULib.tsay( _, "Votemap changelevel halted.", true )
@ -154,10 +155,10 @@ function ulx.votemap( calling_ply, map )
end
end
if #admins <= 0 or vetotime < 1 then
if vetotime < 1 then
ULib.tsay( _, "Vote for map " .. ulx.votemaps[ mapid ] .. " successful! Changing levels now.", true ) -- TODO, color?
ulx.logString( "Votemap for " .. ulx.votemaps[ mapid ] .. " won." )
game.ConsoleCommand( "changelevel " .. ulx.votemaps[ mapid ] .. "\n" )
game.ConsoleCommand( "changelevel \"" .. ulx.votemaps[ mapid ] .. "\"\n" )
else
ULib.tsay( _, "Vote for map " .. ulx.votemaps[ mapid ] .. " successful! Now pending admin approval. (" .. vetotime .. " seconds)", true ) -- TODO, color?
for _, player in ipairs( admins ) do
@ -166,7 +167,13 @@ function ulx.votemap( calling_ply, map )
ulx.logString( "Votemap for " .. ulx.votemaps[ mapid ] .. " won. Pending admin veto." )
ulx.timedVeto = true
hook.Call( ulx.HOOK_VETO )
timer.Create( "ULXVotemap", vetotime, 1, function() game.ConsoleCommand( "changelevel " .. ulx.votemaps[ mapid ] .. "\n" ) end )
ulx.csay(calling_ply, "====== MAP CHANGE IN: " .. vetotime .. " SECOND(S) ======")
local vetotime2 = vetotime - 1
timer.Create( "ULXVotemapNotice", 1, vetotime2, function()
ulx.csay(calling_ply, "====== MAP CHANGE IN: " .. vetotime2 .. " SECOND(S) ======")
vetotime2 = vetotime2 - 1
end )
timer.Create( "ULXVotemap", vetotime, 1, function() game.ConsoleCommand( "changelevel \"" .. ulx.votemaps[ mapid ] .. "\"\n" ) end )
end
end
end

View File

@ -14,6 +14,8 @@ maps.list:AddColumn( "Map Name" )
maps.list.OnRowSelected = function( self, LineID, Line )
if ( ULib.fileExists( "maps/thumb/" .. maps.list:GetSelected()[1]:GetColumnText(1) .. ".png" ) ) then
maps.disp:SetMaterial( Material( "maps/thumb/" .. maps.list:GetSelected()[1]:GetColumnText(1) .. ".png" ) )
elseif ( ULib.fileExists( "maps/" .. maps.list:GetSelected()[1]:GetColumnText(1) .. ".png" ) ) then
maps.disp:SetMaterial( Material( "maps/" .. maps.list:GetSelected()[1]:GetColumnText(1) .. ".png" ) )
else
maps.disp:SetMaterial( Material( "maps/thumb/noicon.png" ) )
end