Ulysses
Ulysses Stuff => Ulysses Release Archives => Releases => Releases for ULX v1.* => Topic started 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.
-- 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" )
-
Good job.
-
>< how do install it im a nooblet at this sry :'(
-
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
-
ehhhhh, so how do you combat noobs going
!restart
every 10 mins? could you put like a time on it? i.e. the restart is allowed every hour after the last restart?
-
!restart not fonctional for me, this is /lua/ULX/modules for ULX 2 ?
-
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.