forked from TeamUlysses/ulx
Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b8bae34837 | ||
![]() |
d490d8cbaa | ||
![]() |
02ecd19a48 | ||
![]() |
e8725048bc | ||
![]() |
9a2c96fc81 | ||
![]() |
3ba3c8ce0e | ||
![]() |
4fd0013c4d | ||
![]() |
c020b9437d | ||
![]() |
76110bdbaa | ||
![]() |
5162e48a31 | ||
![]() |
611419e837 | ||
![]() |
d4981eefa9 | ||
![]() |
fc73984f95 |
@ -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
|
||||
|
@ -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 }
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user