Ulysses Stuff > Suggestions
Want a small addon.
LuaTenshi:
--- Quote from: Aaron113 on August 02, 2011, 12:43:36 PM ---Several problems.
* Your function in this line is wrong.
* Your weapon list should not be in the function. There's no need to set it each time you run the function.
* I'm not even sure what you're trying to do here...But the bold will become a nil value once you get down to here...It'll become a nil value because you ended the first loop, but there is no need for it if you combine them. You can just do this instead...
* Is there really a extra argument that tells the command? I never knew ULX/ULib did this if so.
Finished product should look like this...
--- Code: ----- ULX Carm for ULX SVN/ULib SVN by HeLLFox_15
local WeaponList = {
"weapon_crowbar",
"weapon_stunstick",
"weapon_pistol",
"weapon_smg1",
"weapon_ar2",
"weapon_shotgun",
"weapon_crossbow",
"weapon_frag",
"weapon_rpg",
"weapon_slam",
"weapon_bugbait",
"item_ml_grenade",
"item_ar2_grenade",
"item_ammo_ar2_altfire"
}
function ulx.carm( calling_ply, target_plys, command )
for _, k in ipairs( WeaponList ) do
for _, v in ipairs( target_plys ) do
v:Give(k)
end
end
ulx.fancyLogAdmin( calling_ply, "#A carmed #T", target_plys )
end
local carm = ulx.command( "Utility", "ulx carm", ulx.carm, "!carm" )
carm:addParam{ type=ULib.cmds.PlayersArg }
carm:defaultAccess( ULib.ACCESS_SUPERADMIN )
carm:help( "carm a target(s)." )
--- End code ---
Sorry for going to town on you. :P
--- End quote ---
Its OK, reading this actually made me laugh at my self and made my day. I miss-typed on the "ccarm" part and I don't know what possessed me to put the "command" part in there.
Ps: I would like you to help me with my game-mode, because the idea I have is simply complicated here it is here...
http://forums.ulyssesmod.net/index.php/topic,5361.0.html
Navigation
[0] Message Index
[*] Previous page
Go to full version