Okay so basically what I want to know how would I restrict ULX Commands to a set DarkRP team say i want to make the script below only to be used by TEAM_EP & TEAM_SOD
local CATEGORY_NAME = "Apple's Creations"
function ulx.giveweapon( calling_ply, target_plys, weapon )
local affected_plys = {}
for i=1, #target_plys do
local v = target_plys[ i ]
if not v:Alive() then
ULib.tsayError( calling_ply, v:Nick() .. " is dead", true )
else
v:Give(weapon)
table.insert( affected_plys, v )
end
end
ulx.fancyLogAdmin( calling_ply, "#A gave #T weapon #s", affected_plys, weapon )
end
local giveweapon = ulx.command( CATEGORY_NAME, "ulx giveweapon", ulx.giveweapon, "!giveweapon" )
giveweapon:addParam{ type=ULib.cmds.PlayersArg }
giveweapon:addParam{ type=ULib.cmds.StringArg, hint="weapon name" }
giveweapon:defaultAccess( ULib.ACCESS_ADMIN )
giveweapon:help( "Give a player a weapon - !giveweapon" )
function ulx.sgiveweapon( calling_ply, target_plys, weapon )
local affected_plys = {}
for i=1, #target_plys do
local v = target_plys[ i ]
if not v:Alive() then
ULib.tsayError( calling_ply, v:Nick() .. " is dead", true )
else
v:Give(weapon)
table.insert( affected_plys, v )
end
end
end
local sgiveweapon = ulx.command( CATEGORY_NAME, "ulx sgiveweapon", ulx.sgiveweapon )
sgiveweapon:addParam{ type=ULib.cmds.PlayersArg }
sgiveweapon:addParam{ type=ULib.cmds.StringArg, hint="weapon name" }
sgiveweapon:defaultAccess( ULib.ACCESS_ADMIN )
sgiveweapon:help( "Give a player a weapon silently" )