General > Developers Corner
ULX Unlimited Ammo
COOLJ:
--- Quote from: BobTheDuck69 on March 12, 2015, 11:21:47 AM ---I cant help with that its a broken command but i can give you one that works
--- Code: ---function ulx.ammo( calling_ply, target_plys, amount, should_setammo )
for i=1, #target_plys do
local player = target_plys[ i ]
local actwep = player:GetActiveWeapon()
local curammo = actwep:GetPrimaryAmmoType()
if !should_setammo then
player:GiveAmmo( amount, curammo )
else
player:SetAmmo( amount, curammo )
end
end
if should_setammo then
ulx.fancyLogAdmin( calling_ply, "#A set the ammo for #T to #s", target_plys, amount )
else
ulx.fancyLogAdmin( calling_ply, "#A gave #T #i rounds", target_plys, amount )
end
end
local ammo = ulx.command( "Custom", "ulx giveammo", ulx.ammo, "!giveammo" )
ammo:addParam{ type=ULib.cmds.PlayersArg }
ammo:addParam{ type=ULib.cmds.NumArg, min=0, hint="amount" }
ammo:addParam{ type=ULib.cmds.BoolArg, invisible=true }
ammo:defaultAccess( ULib.ACCESS_ADMIN )
ammo:help( "Set a player's ammo" )
ammo:setOpposite( "ulx setammo", { _, _, _, true }, "!setammo" )
--- End code ---
--- End quote ---
Is that already on Releases if not may I use this and upload it?
kem008:
I think this topic got no solution it would be better if a moderator can close it.
WispySkies:
You don't need to close this thread just because there is no answer, if anyone is interested in wanting this I can make something for it to work.
EDIT: So far all it does is freeze your game.
Navigation
[0] Message Index
[*] Previous page
Go to full version