Ulysses

Ulysses Stuff => Ulysses Release Archives => Releases => Releases for ULX v1.* => Topic started by: fackelkind on July 10, 2006, 01:28:16 PM

Title: ULX Restartmap
Post by: fackelkind on July 10, 2006, 01:28:16 PM
Hey a simples small script, which guves a vote to restart map:
Allows everybody to use !restart, if not a MAPADMIN is online, else just the MAPADMINS are allowed.


Code: [Select]
-- cc_ulxVotekick
function cc_ulxVoterestart( userid, args, argv, argc )
local target = _GetCurrentMap()
if target == nil then
return
end
        if hasAccess (userid, ACCESS_MAP) == false then
                for i = 1, _MaxPlayers() do
                        if hasAccess (i, ACCESS_MAP) == true then
                                _PrintMessage (userid, HUD_PRINTTALK, "You cannot perform this action, while an admin is online.")
                                return
                        end
                end
        end

menu_sendVote( ulx_voterestartCallback, _, "Restart " .. target .. "?", "Yes", target, "No", false )
end

function ulx_voterestartCallback( id )
if id == nil or id == ID_NONE or id == false then
ulx_tsay_all( "Voterestart unsuccessful." )
return
end

ulx_tsay_all( "Restarting map " .. id .. " in 5 seconds." )
AddTimer (5, 1, _ServerCommand, "changelevel " .. id .. "\n" )
end

ULX_CONCOMMAND( "ulx_restart", cc_ulxVoterestart, nil, "Gives the users a vote to restart the current map", 0, "!restart" )
Title: Re: ULX Restartmap
Post by: Megiddo on July 10, 2006, 04:34:08 PM
Good job.
Title: Re: ULX Restartmap
Post by: sparts on August 05, 2006, 06:16:39 AM
>< how do install it im a nooblet at this sry  :'(
Title: Re: ULX Restartmap
Post by: JamminR on August 05, 2006, 08:57:19 AM
Copy and paste the above code into a file using notepad,
save it as something like 'restartmap.lua' or any other filename.lua you want
save it in gmod9/lua/ulx/modules
Title: Re: ULX Restartmap
Post by: Griff on August 05, 2006, 05:02:25 PM
ehhhhh, so how do you combat noobs going
Quote
!restart
every 10 mins? could you put like a time on it? i.e. the restart is allowed every hour after the last restart?
Title: Re: ULX Restartmap
Post by: Ulrar on August 07, 2006, 12:55:38 PM
!restart not fonctional for me, this is /lua/ULX/modules for ULX 2 ?
Title: Re: ULX Restartmap
Post by: JamminR on August 07, 2006, 05:10:23 PM
PLEASE see the name of this forum

"Releases for ULX v1.*"

NOT "Releases for ULX v2"

There is no current place to post specific ULX v2 releases.
I'd recommend using the Ulib -> Releases section for now.
Once Megiddo gets back, if he wishes, he can make a ULX v2 releases section.