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" )