Advertisement
Prior_

Untitled

Jan 2nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.72 KB | None | 0 0
  1. /*
  2. function ulx.bpromote( calling_ply, target_plys )
  3.    
  4.     local t,targetrank = {},{}
  5.    
  6.         for i = 1, #target_plys do
  7.           t = target_plys[ i ]
  8.           targetrank = t:GetRank()
  9.         end
  10.  
  11.     if calling_ply == t then
  12.     calling_ply:PrintMessage( HUD_PRINTTALK, "You cannot promote yourself." )      
  13.     return "" end
  14.  
  15.     if calling_ply:GetRankCategory() == "5" and calling_ply:GetRank() < 5 then
  16.     calling_ply:PrintMessage( HUD_PRINTTALK, "You must be atleast a Jnr Intelligence Officer to promote others." )
  17.     return "" end
  18.  
  19.     if calling_ply:GetRankCategory() == "1" and calling_ply:GetRank() < 8 then
  20.     calling_ply:PrintMessage( HUD_PRINTTALK, "You must be atleast 2nd Lieutenant to promote others." )
  21.     return "" end
  22.  
  23.     if calling_ply:GetRankCategory() == "3" and calling_ply:GetRank() < 5 then
  24.     calling_ply:PrintMessage( HUD_PRINTTALK, "You must be atleast Lieutenant Commander to promote others." )
  25.     return "" end
  26.  
  27.     if calling_ply:GetRankCategory() == "4" and calling_ply:GetRank() != 5 then
  28.     calling_ply:PrintMessage( HUD_PRINTTALK, "You cannot promote people, unless your a High Councillor!" )
  29.     return "" end
  30.    
  31.     if t:Team() != calling_ply:Team() then
  32.     calling_ply:PrintMessage( HUD_PRINTTALK, "You cannot promote people who aren't in the same regiment as you." )
  33.     return "" end
  34.    
  35.         if calling_ply:GetRankCategory() == "1" and t:GetRank() >= (calling_ply:GetRank() - 1 ) then
  36.     calling_ply:PrintMessage( HUD_PRINTTALK, "You cannot promote people to the same rank as you or higher rank then you." )
  37.     return "" end
  38.  
  39.     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
  40.     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." )
  41.     return "" end
  42.  
  43.     if (calling_ply:GetRankCategory() == "1" or calling_ply:GetRankCategory() == "2") and (not t:GetRankCategory() == "1" or not t:GetRankCategory() == "2") then
  44.     calling_ply:PrintMessage( HUD_PRINTTALK, "You can only promote other Clone Troopers, if you feel someone else needs a promotion, contact their Superiors." )
  45.     return "" end
  46.  
  47.     if targetrank == nil then
  48.         v:SetRank( "0" )
  49.     end
  50.  
  51.     local hackyrank = t:GetRank() or 1
  52.     t:SetRank(hackyrank + 1)
  53.  
  54.     GetCorrectRankUp( t, t:GetRank(), false )
  55.     ulx.fancyLogAdmin( calling_ply, "#A promoted #T", affected_plys )
  56.  
  57. end
  58. local bpromote = ulx.command( CATEGORY_NAME, "ulx bpromote", ulx.bpromote, "!bpromote" )
  59. bpromote:addParam{ type=ULib.cmds.PlayersArg }
  60. bpromote:defaultAccess( ULib.ACCESS_ADMIN )
  61. bpromote:help( "Promotes target(s)." )
  62. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement