Prior_

Untitled

Nov 1st, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. function ulx.bpromote( calling_ply, target_plys )
  2.  
  3. if target_plys:GetRank() > calling_ply:GetRank() then
  4. if target_plys:Team() != calling_ply:Team()
  5. end
  6.  
  7. for i = 1, #target_plys do
  8. local v = target_plys[ i ]
  9. local therank = v:GetRank()
  10.  
  11. if therank == nil then
  12. v:SetRank( "0" )
  13. end
  14.  
  15. local hackyrank = v:GetRank() or 1
  16. v:SetRank(hackyrank + 1)
  17.  
  18. GetCorrectRankUp( v, v:GetRank(), false )
  19. end
  20. ulx.fancyLogAdmin( calling_ply, "#A promoted #T", affected_plys )
  21. end
  22. local bpromote = ulx.command( CATEGORY_NAME, "ulx bpromote", ulx.bpromote, "!bpromote" )
  23. bpromote:addParam{ type=ULib.cmds.PlayersArg }
  24. bpromote:defaultAccess( ULib.ACCESS_ADMIN )
  25. bpromote:help( "Promotes target(s)." )
  26.  
  27. function ulx.apromote( calling_ply, target_plys )
  28. for i = 1, #target_plys do
  29. local v = target_plys[ i ]
  30. local therank = v:GetRank()
  31.  
  32. if therank == nil then
  33. v:SetRank( "0" )
  34. end
  35.  
  36. local hackyrank = v:GetRank() or 1
  37. v:SetRank(hackyrank + 1)
  38.  
  39. GetCorrectRankUp( v, v:GetRank(), false )
  40. end
  41. ulx.fancyLogAdmin( calling_ply, "#A promoted #T", affected_plys )
  42. end
  43. local apromote = ulx.command( CATEGORY_NAME, "ulx apromote", ulx.apromote, "!apromote" )
  44. apromote:addParam{ type=ULib.cmds.PlayersArg }
  45. apromote:defaultAccess( ULib.ACCESS_ADMIN )
  46. apromote:help( "Admin Promotes target(s)." )
Advertisement
Add Comment
Please, Sign In to add comment