Advertisement
Prior_

Untitled

Dec 20th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.38 KB | None | 0 0
  1. local CATEGORY_NAME = "BlinkRank"
  2.  
  3. function ulx.bpromote( calling_ply, target_plys )
  4.  
  5. local t,targetrank = {},{}
  6.  
  7. for i = 1, #target_plys do
  8. t = target_plys[ i ]
  9. targetrank = t:GetRank()
  10. end
  11.  
  12. if t:GetRank() > calling_ply:GetRank() or t:Team() != calling_ply:Team() then
  13. return
  14. end
  15.  
  16. // Default code shit under here.
  17.  
  18. if targetrank == nil then
  19. v:SetRank( "0" )
  20. end
  21.  
  22. local hackyrank = t:GetRank() or 1
  23. t:SetRank(hackyrank + 1)
  24.  
  25. GetCorrectRankUp( t, t:GetRank(), false )
  26. ulx.fancyLogAdmin( calling_ply, "#A promoted #T", affected_plys )
  27.  
  28. end
  29. local bpromote = ulx.command( CATEGORY_NAME, "ulx bpromote", ulx.bpromote, "!bpromote" )
  30. bpromote:addParam{ type=ULib.cmds.PlayersArg }
  31. bpromote:defaultAccess( ULib.ACCESS_ADMIN )
  32. bpromote:help( "Promotes target(s)." )
  33.  
  34. function ulx.apromote( calling_ply, target_plys )
  35. for i = 1, #target_plys do
  36. local v = target_plys[ i ]
  37. local therank = v:GetRank()
  38.  
  39. if therank == nil then
  40. v:SetRank( "0" )
  41. end
  42.  
  43. local hackyrank = v:GetRank() or 1
  44. v:SetRank(hackyrank + 1)
  45.  
  46. GetCorrectRankUp( v, v:GetRank(), false )
  47. end
  48. ulx.fancyLogAdmin( calling_ply, "#A promoted #T", affected_plys )
  49. end
  50. local apromote = ulx.command( CATEGORY_NAME, "ulx apromote", ulx.apromote, "!apromote" )
  51. apromote:addParam{ type=ULib.cmds.PlayersArg }
  52. apromote:defaultAccess( ULib.ACCESS_ADMIN )
  53. apromote:help( "Admin Promotes target(s)." )
  54.  
  55. function ulx.bcharacter( calling_ply, target_plys, char )
  56. for i=1, #target_plys do
  57. local v = target_plys[ i ]
  58. v:SetCharacter( char )
  59.  
  60. if v:GetCloneNick() == nil then
  61. SetAllToName(v, "Unnamed", "4352", 1, 1)
  62. end
  63. GetCorrectRankUp( v, v:GetRank(), false )
  64. end
  65. ulx.fancyLogAdmin( calling_ply, "#A changed #T's character.", affected_plys )
  66. end
  67. local bcharacter = ulx.command( CATEGORY_NAME, "ulx bcharacter", ulx.bcharacter, "!bcharacter" )
  68. bcharacter:addParam{ type=ULib.cmds.PlayersArg, default="@" }
  69. bcharacter:addParam{ type=ULib.cmds.NumArg, min=1, max=MaxCharacters }
  70. bcharacter:defaultAccess( ULib.ACCESS_ADMIN )
  71. bcharacter:help( "Changes the character which allows people to have different RP sessions." )
  72.  
  73. function ulx.bnickname( calling_ply, target_plys, nick )
  74. for i=1, #target_plys do
  75. local v = target_plys[ i ]
  76. v:SetCloneNick( nick )
  77.  
  78. GetCorrectRankUp( v, v:GetRank(), false )
  79. end
  80. ulx.fancyLogAdmin( calling_ply, "#A changed #T's nickname.", affected_plys )
  81. end
  82. local bnickname = ulx.command( CATEGORY_NAME, "ulx bnickname", ulx.bnickname, "!bnickname" )
  83. bnickname:addParam{ type=ULib.cmds.PlayersArg, default="@" }
  84. bnickname:addParam{ type=ULib.cmds.StringArg }
  85. bnickname:defaultAccess( ULib.ACCESS_ADMIN )
  86. bnickname:help( "Changes the Nickname of the target." )
  87.  
  88. function ulx.bprefix( calling_ply, target_plys, prefix )
  89. for i=1, #target_plys do
  90. local v = target_plys[ i ]
  91. v:SetPrefix( prefix )
  92.  
  93. GetCorrectRankUp( v, v:GetRank(), false )
  94. end
  95. ulx.fancyLogAdmin( calling_ply, "#A changed #T's prefix.", affected_plys )
  96. end
  97. local bprefix = ulx.command( CATEGORY_NAME, "ulx bprefix", ulx.bprefix, "!bprefix" )
  98. bprefix:addParam{ type=ULib.cmds.PlayersArg, default="@" }
  99. bprefix:addParam{ type=ULib.cmds.StringArg }
  100. bprefix:defaultAccess( ULib.ACCESS_ADMIN )
  101. bprefix:help( "Changes the Prefix of the target." )
  102.  
  103. function ulx.bremoveprefix( calling_ply, target_plys )
  104. for i=1, #target_plys do
  105. local v = target_plys[ i ]
  106. v:RemovePrefix()
  107.  
  108. GetCorrectRankUp( v, v:GetRank(), false )
  109. end
  110. ulx.fancyLogAdmin( calling_ply, "#A removed #T's prefix.", affected_plys )
  111. end
  112. local bremoveprefix = ulx.command( CATEGORY_NAME, "ulx bremoveprefix", ulx.bremoveprefix, "!bremoveprefix" )
  113. bremoveprefix:addParam{ type=ULib.cmds.PlayersArg, default="@" }
  114. bremoveprefix:defaultAccess( ULib.ACCESS_ADMIN )
  115. bremoveprefix:help( "Removes the Prefix of the target." )
  116.  
  117. function ulx.bidnumber( calling_ply, target_plys, id )
  118. for i=1, #target_plys do
  119. local v = target_plys[ i ]
  120. v:SetCloneID( id )
  121.  
  122. GetCorrectRankUp( v, v:GetRank(), false )
  123. end
  124. ulx.fancyLogAdmin( calling_ply, "#A changed #T's ID.", affected_plys )
  125. end
  126. local bidnumber = ulx.command( CATEGORY_NAME, "ulx bidnumber", ulx.bidnumber, "!bidnumber" )
  127. bidnumber:addParam{ type=ULib.cmds.PlayersArg, default="@" }
  128. bidnumber:addParam{ type=ULib.cmds.StringArg }
  129. bidnumber:defaultAccess( ULib.ACCESS_ADMIN )
  130. bidnumber:help( "Changes the ID of the target." )
  131.  
  132. function ulx.bdemote( calling_ply, target_plys )
  133.  
  134. if target_plys:GetRank() > calling_ply:GetRank() then
  135. if target_plys:Team() != calling_ply:Team() then return
  136. end end
  137.  
  138. for i=1, #target_plys do
  139. local v = target_plys[ i ]
  140. local therank = v:GetRank()
  141.  
  142. if therank == nil then
  143. v:SetRank( "2" )
  144. end
  145.  
  146. local totsnumb = (v:GetRank() - 1)
  147. v:SetRank(totsnumb)
  148. GetCorrectRankUp( v, v:GetRank(), false )
  149. end
  150. ulx.fancyLogAdmin( calling_ply, "#A demoted #T", affected_plys )
  151. end
  152. local bdemote = ulx.command( CATEGORY_NAME, "ulx bdemote", ulx.bdemote, "!bdemote" )
  153. bdemote:addParam{ type=ULib.cmds.PlayersArg }
  154. bdemote:defaultAccess( ULib.ACCESS_ADMIN )
  155. bdemote:help( "Demotes target(s)." )
  156.  
  157. function ulx.ademote( calling_ply, target_plys )
  158. for i=1, #target_plys do
  159. local v = target_plys[ i ]
  160. local therank = v:GetRank()
  161.  
  162. if therank == nil then
  163. v:SetRank( "2" )
  164. end
  165.  
  166. local totsnumb = (v:GetRank() - 1)
  167. v:SetRank(totsnumb)
  168. GetCorrectRankUp( v, v:GetRank(), false )
  169. end
  170. ulx.fancyLogAdmin( calling_ply, "#A demoted #T", affected_plys )
  171. end
  172. local ademote = ulx.command( CATEGORY_NAME, "ulx ademote", ulx.ademote, "!ademote" )
  173. ademote:addParam{ type=ULib.cmds.PlayersArg }
  174. ademote:defaultAccess( ULib.ACCESS_ADMIN )
  175. ademote:help( "Admin Demotes target(s)." )
  176.  
  177. function ulx.bcategory( calling_ply, target_plys, cat )
  178. for i=1, #target_plys do
  179. local v = target_plys[ i ]
  180. v:SetRankCategory( cat )
  181. end
  182. ulx.fancyLogAdmin( calling_ply, "#A changed #T's character category.", affected_plys )
  183. end
  184. local bcategory = ulx.command( CATEGORY_NAME, "ulx bcategory", ulx.bcategory, "!bcategory" )
  185. bcategory:addParam{ type=ULib.cmds.PlayersArg, default="@" }
  186. bcategory:addParam{ type=ULib.cmds.NumArg, min=1, max=100 }
  187. bcategory:defaultAccess( ULib.ACCESS_ADMIN )
  188. bcategory:help( "Changes the category and resets their rank to that category's first rank." )
  189.  
  190. function ulx.train( calling_ply, target_plys )
  191. for i=1, #target_plys do
  192. local v = target_plys[ i ]
  193. local recruit = target_plys[ i ]
  194.  
  195. if v:Rank() > 1 or if v:GetRankCategory() > 1 then
  196. if calling_ply:GetRankCategory() == 1 and calling_ply:Rank() <= 4 then return
  197. end
  198.  
  199. v:Promote()
  200. PRegiments.SQL.Wrappers.SetPlayerClass(recruit, 2)
  201. end
  202.  
  203. ulx.fancyLogAdmin( calling_ply, "#A trained #T", affected_plys )
  204. end
  205. local bcategory = ulx.command( CATEGORY_NAME, "ulx train", ulx.train, "!train" )
  206. train:addParam{ type=ULib.cmds.PlayersArg }
  207. train:defaultAccess( ULib.ACCESS_ADMIN )
  208. train:help( "Changes the player's loadout/model and promotes the player to CT." )
  209.  
  210. print("[BlinkRank] ULX Loaded")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement