Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Vote Force Boss--
- function ulx.forceboss( calling_ply, target_plys )
- local affected_plys = {}
- for i=1, #target_plys do
- local v = target_plys[ i ]
- if v:IsFrozen() then
- ULib.tsayError( calling_ply, v:Nick() .. " is frozen!", true )
- elseif v:Team() == TEAM_HUMAN then
- ULib.tsayError( calling_ply, v:Nick() .. " is a human!", true )
- else
- GAMEMODE:SpawnBossZombie(v)
- table.insert( affected_plys, v )
- end
- end
- ulx.fancyLogAdmin( calling_ply, "#A forced #T to be boss.", affected_plys )
- end
- local forceboss = ulx.command( CATEGORY_NAME, "ulx forceboss", ulx.forceboss, "!forceboss" )
- forceboss:addParam{ type=ULib.cmds.PlayersArg }
- forceboss:defaultAccess(ULib.ACCESS_ALL)
- forceboss:help( "Sets target(s) as boss." )
- function ulx.voteboss( calling_ply, target_ply, reason )
- if ulx.voteInProgress then
- ULib.tsayError( calling_ply, "There is already a vote in progress. Please wait for the current one to end.", true )
- return
- end
- local msg = "Boss " .. target_ply:Nick() .. "?"
- if reason and reason ~= "" then
- msg = msg .. " (" .. reason .. ")"
- end
- ulx.doVote( msg, { "Yes", "No" }, voteBossDone, _, _, _, target_ply, calling_ply )
- if reason and reason ~= "" then
- ulx.fancyLogAdmin( calling_ply, "#A started a voteboss for #T (#s)", target_ply )
- else
- ulx.fancyLogAdmin( calling_ply, "#A started a voteboss for #T", target_ply )
- end
- end
- local votekick = ulx.command( CATEGORY_NAME, "ulx voteboss", ulx.voteboss, "!voteboss" )
- votekick:addParam{ type=ULib.cmds.PlayerArg }
- votekick:defaultAccess( ULib.ACCESS_ADMIN )
- votekick:help( "Starts a public vote for a forceboss." )
- if SERVER then ulx.convar( "votekickSuccessratio", "0.6", _, ULib.ACCESS_ADMIN ) end -- The ratio needed for a votekick to succeed
- if SERVER then ulx.convar( "votekickMinvotes", "2", _, ULib.ACCESS_ADMIN ) end -- Minimum votes needed for votekick
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement