Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- function ulx.bpromote( calling_ply, target_plys )
- local t,targetrank = {},{}
- for i = 1, #target_plys do
- t = target_plys[ i ]
- targetrank = t:GetRank()
- end
- if calling_ply == t then
- calling_ply:PrintMessage( HUD_PRINTTALK, "You cannot promote yourself." )
- return "" end
- if calling_ply:GetRankCategory() == "5" and calling_ply:GetRank() < 5 then
- calling_ply:PrintMessage( HUD_PRINTTALK, "You must be atleast a Jnr Intelligence Officer to promote others." )
- return "" end
- if calling_ply:GetRankCategory() == "1" and calling_ply:GetRank() < 8 then
- calling_ply:PrintMessage( HUD_PRINTTALK, "You must be atleast 2nd Lieutenant to promote others." )
- return "" end
- if calling_ply:GetRankCategory() == "3" and calling_ply:GetRank() < 5 then
- calling_ply:PrintMessage( HUD_PRINTTALK, "You must be atleast Lieutenant Commander to promote others." )
- return "" end
- if calling_ply:GetRankCategory() == "4" and calling_ply:GetRank() != 5 then
- calling_ply:PrintMessage( HUD_PRINTTALK, "You cannot promote people, unless your a High Councillor!" )
- return "" end
- if t:Team() != calling_ply:Team() then
- calling_ply:PrintMessage( HUD_PRINTTALK, "You cannot promote people who aren't in the same regiment as you." )
- return "" end
- if calling_ply:GetRankCategory() == "1" and t:GetRank() >= (calling_ply:GetRank() - 1 ) then
- calling_ply:PrintMessage( HUD_PRINTTALK, "You cannot promote people to the same rank as you or higher rank then you." )
- return "" end
- if (calling_ply:GetRankCategory() == t:GetRankCategory()) and (!calling_ply:GetRankCategory() == "1" or !calling_ply:GetRankCategory() == "2" or !t:GetRankCategory() == "1" or !t:GetRankCategory() == "2") then
- calling_ply:PrintMessage( HUD_PRINTTALK, "You can only promote people in the same Rank Category, if you feel someone else needs a promotion, contact their Superiors." )
- return "" end
- if (calling_ply:GetRankCategory() == "1" or calling_ply:GetRankCategory() == "2") and (not t:GetRankCategory() == "1" or not t:GetRankCategory() == "2") then
- calling_ply:PrintMessage( HUD_PRINTTALK, "You can only promote other Clone Troopers, if you feel someone else needs a promotion, contact their Superiors." )
- return "" end
- if targetrank == nil then
- v:SetRank( "0" )
- end
- local hackyrank = t:GetRank() or 1
- t:SetRank(hackyrank + 1)
- GetCorrectRankUp( t, t:GetRank(), false )
- ulx.fancyLogAdmin( calling_ply, "#A promoted #T", affected_plys )
- end
- local bpromote = ulx.command( CATEGORY_NAME, "ulx bpromote", ulx.bpromote, "!bpromote" )
- bpromote:addParam{ type=ULib.cmds.PlayersArg }
- bpromote:defaultAccess( ULib.ACCESS_ADMIN )
- bpromote:help( "Promotes target(s)." )
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement