Advertisement
PredaCarbon

Untitled

Nov 24th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. function ulx.give( calling_ply, target_plys, entity, should_silent )
  2.  
  3. for k,v in pairs( target_plys ) do
  4.  
  5. if ( not v:Alive() ) then -- Is the player dead?
  6.  
  7. ULib.tsayError( calling_ply, v:Nick() .. " мёртв!", true )
  8.  
  9. elseif v:IsFrozen() then -- Is the player frozen?
  10.  
  11. ULib.tsayError( calling_ply, v:Nick() .. " заморожен!", true )
  12.  
  13. elseif v:InVehicle() then -- Is the player in a vehicle?
  14.  
  15. ULib.tsayError( calling_ply, v:Nick() .. " в авто.", true )
  16.  
  17. else
  18.  
  19. v:Give( entity )
  20.  
  21. end
  22.  
  23. end
  24.  
  25. if should_silent then
  26.  
  27. ulx.fancyLogAdmin( calling_ply, true, "#A выдал #T #s", target_plys, entity )
  28.  
  29. else
  30.  
  31. ulx.fancyLogAdmin( calling_ply, "#A выдал #T #s", target_plys, entity )
  32.  
  33. end
  34.  
  35. end
  36. local give = ulx.command( "Utility", "ulx give", ulx.give, "!give" )
  37. give:addParam{ type=ULib.cmds.PlayersArg }
  38. give:addParam{ type=ULib.cmds.StringArg, hint="entity" }
  39. give:addParam{ type=ULib.cmds.BoolArg, invisible=true }
  40. give:defaultAccess( ULib.ACCESS_ADMIN )
  41. give:help( "Give a player an entity" )
  42. give:setOpposite ( "ulx sgive", { _, _, _, true }, "!sgive", true )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement