Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ulx.give( calling_ply, target_plys, entity, should_silent )
- for k,v in pairs( target_plys ) do
- if ( not v:Alive() ) then -- Is the player dead?
- ULib.tsayError( calling_ply, v:Nick() .. " мёртв!", true )
- elseif v:IsFrozen() then -- Is the player frozen?
- ULib.tsayError( calling_ply, v:Nick() .. " заморожен!", true )
- elseif v:InVehicle() then -- Is the player in a vehicle?
- ULib.tsayError( calling_ply, v:Nick() .. " в авто.", true )
- else
- v:Give( entity )
- end
- end
- if should_silent then
- ulx.fancyLogAdmin( calling_ply, true, "#A выдал #T #s", target_plys, entity )
- else
- ulx.fancyLogAdmin( calling_ply, "#A выдал #T #s", target_plys, entity )
- end
- end
- local give = ulx.command( "Utility", "ulx give", ulx.give, "!give" )
- give:addParam{ type=ULib.cmds.PlayersArg }
- give:addParam{ type=ULib.cmds.StringArg, hint="entity" }
- give:addParam{ type=ULib.cmds.BoolArg, invisible=true }
- give:defaultAccess( ULib.ACCESS_ADMIN )
- give:help( "Give a player an entity" )
- give:setOpposite ( "ulx sgive", { _, _, _, true }, "!sgive", true )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement