Ulysses Stuff > Releases for ULX v1.*

ULX Restartmap

(1/2) > >>

fackelkind:
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: ----- 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" )
--- End code ---

Megiddo:
Good job.

sparts:
>< how do install it im a nooblet at this sry  :'(

JamminR:
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

Griff:
ehhhhh, so how do you combat noobs going
--- Quote ---!restart
--- End quote ---
every 10 mins? could you put like a time on it? i.e. the restart is allowed every hour after the last restart?

Navigation

[0] Message Index

[#] Next page

Go to full version