Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.50 KB | None | 0 0
  1. nclude("sv_items_table.lua")
  2.  
  3. concommand.Add("gmodz_giveitem", function( ply, cmd, args )
  4. local hasValue = table.HasValue( gmodz_items, args[1] )
  5. local amount = 1
  6. local amountStr = tostring( 1 )
  7.  
  8. if hasValue == true then
  9. if ply:IsUserGroup("owner") or ply:IsUserGroup("co_owner") or ply:IsUserGroup("manager") then
  10. ply:AddItem( args[1] )
  11. ply:ChatPrint( "You have given yourself an item! (" ..args[1].. ")" )
  12. gmodz_log( "logs_items_give", ply:Nick().." has just spawned x"..amountStr.." of "..args[1] )
  13. else
  14. ply:ChatPrint( "You do not have access to this command!" )
  15. end
  16. else
  17. ply:ChatPrint("That is not a valid item classname!")
  18. end
  19. end )
  20.  
  21. concommand.Add("gmodz_giveitem_5", function( ply, cmd, args )
  22. local hasValue = table.HasValue( gmodz_items, args[1] )
  23. local amount = 5
  24. local amountStr = tostring( 5 )
  25.  
  26. if hasValue == true then
  27. if ply:IsUserGroup("owner") or ply:IsUserGroup("co_owner") or ply:IsUserGroup("manager") then
  28. for i=1, amount do
  29. ply:AddItem( args[1] )
  30. end
  31. ply:ChatPrint( "You have given yourself an item! (" ..args[1].. ") x" ..amountStr )
  32. gmodz_log( "logs_items_give", ply:Nick().." has just spawned x"..amountStr.." of "..args[1] )
  33. else
  34. ply:ChatPrint( "You do not have access to this command!" )
  35. end
  36. else
  37. ply:ChatPrint("That is not a valid item classname!")
  38. end
  39. end )
  40.  
  41. concommand.Add("gmodz_giveitem_10", function( ply, cmd, args )
  42. local hasValue = table.HasValue( gmodz_items, args[1] )
  43. local amount = 10
  44. local amountStr = tostring( 10 )
  45.  
  46. if hasValue == true then
  47. if ply:IsUserGroup("owner") or ply:IsUserGroup("co_owner") or ply:IsUserGroup("manager") then
  48. for i=1, amount do
  49. ply:AddItem( args[1] )
  50. end
  51. ply:ChatPrint( "You have given yourself an item! (" ..args[1].. ") x" ..amountStr )
  52. gmodz_log( "logs_items_give", ply:Nick().." has just spawned x"..amountStr.." of "..args[1] )
  53. else
  54. ply:ChatPrint( "You do not have access to this command!" )
  55. end
  56. else
  57. ply:ChatPrint("That is not a valid item classname!")
  58. end
  59. end )
  60.  
  61. concommand.Add("gmodz_giveitem_20", function( ply, cmd, args )
  62. local hasValue = table.HasValue( gmodz_items, args[1] )
  63. local amount = 20
  64. local amountStr = tostring( 20 )
  65.  
  66. if hasValue == true then
  67. if ply:IsUserGroup("owner") or ply:IsUserGroup("co_owner") or ply:IsUserGroup("manager") then
  68. for i=1, amount do
  69. ply:AddItem( args[1] )
  70. end
  71. ply:ChatPrint( "You have given yourself an item! (" ..args[1].. ") x" ..amountStr )
  72. gmodz_log( "logs_items_give", ply:Nick().." has just spawned x"..amountStr.." of "..args[1] )
  73. else
  74. ply:ChatPrint( "You do not have access to this command!" )
  75. end
  76. else
  77. ply:ChatPrint("That is not a valid item classname!")
  78. end
  79. end )
  80.  
  81. concommand.Add("gmodz_giveitem_50", function( ply, cmd, args )
  82. local hasValue = table.HasValue( gmodz_items, args[1] )
  83. local amount = 50
  84. local amountStr = tostring( 50 )
  85.  
  86. if hasValue == true then
  87. if ply:IsUserGroup("owner") or ply:IsUserGroup("co_owner") or ply:IsUserGroup("manager") then
  88. for i=1, amount do
  89. ply:AddItem( args[1] )
  90. end
  91. ply:ChatPrint( "You have given yourself an item! (" ..args[1].. ") x" ..amountStr )
  92. gmodz_log( "logs_items_give", ply:Nick().." has just spawned x"..amountStr.." of "..args[1] )
  93. else
  94. ply:ChatPrint( "You do not have access to this command!" )
  95. end
  96. else
  97. ply:ChatPrint("That is not a valid item classname!")
  98. end
  99. end )
  100.  
  101. concommand.Add("gmodz_giveitem_100", function( ply, cmd, args )
  102. local hasValue = table.HasValue( gmodz_items, args[1] )
  103. local amount = 100
  104. local amountStr = tostring( 100 )
  105.  
  106. if hasValue == true then
  107. if ply:IsUserGroup("owner") or ply:IsUserGroup("co_owner") or ply:IsUserGroup("manager") then
  108. for i=1, amount do
  109. ply:AddItem( args[1] )
  110. end
  111. ply:ChatPrint( "You have given yourself an item! (" ..args[1].. ") x" ..amountStr )
  112. gmodz_log( "logs_items_give", ply:Nick().." has just spawned x"..amountStr.." of "..args[1] )
  113. else
  114. ply:ChatPrint( "You do not have access to this command!" )
  115. end
  116. else
  117. ply:ChatPrint("That is not a valid item classname!")
  118. end
  119. end )
  120.  
  121. concommand.Add("gmodz_giveitem_1k", function( ply, cmd, args )
  122. local hasValue = table.HasValue( gmodz_items, args[1] )
  123. local amount = 1000
  124. local amountStr = tostring( 1000 )
  125.  
  126. if hasValue == true then
  127. if ply:IsUserGroup("owner") or ply:IsUserGroup("co_owner") or ply:IsUserGroup("manager") then
  128. for i=1, amount do
  129. ply:AddItem( args[1] )
  130. end
  131. ply:ChatPrint( "You have given yourself an item! (" ..args[1].. ") x" ..amountStr )
  132. gmodz_log( "logs_items_give", ply:Nick().." has just spawned x"..amountStr.." of "..args[1] )
  133. else
  134. ply:ChatPrint( "You do not have access to this command!" )
  135. end
  136. else
  137. ply:ChatPrint("That is not a valid item classname!")
  138. end
  139. end )
  140.  
  141. concommand.Add("gmodz_giveitem_10k", function( ply, cmd, args )
  142. local hasValue = table.HasValue( gmodz_items, args[1] )
  143. local amount = 10000
  144. local amountStr = tostring( 10000 )
  145.  
  146. if hasValue == true then
  147. if ply:IsUserGroup("owner") or ply:IsUserGroup("co_owner") or ply:IsUserGroup("manager") then
  148. for i=1, amount do
  149. ply:AddItem( args[1] )
  150. end
  151. ply:ChatPrint( "You have given yourself an item! (" ..args[1].. ") x" ..amountStr )
  152. gmodz_log( "logs_items_give", ply:Nick().." has just spawned x"..amountStr.." of "..args[1] )
  153. else
  154. ply:ChatPrint( "You do not have access to this command!" )
  155. end
  156. else
  157. ply:ChatPrint("That is not a valid item classname!")
  158. end
  159. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement