Prior_

Untitled

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