• Posting all lua files in a directory to console
    4 replies, posted
I need a way to post all .lua files in a certain directory that start with sh_weapon_*.lua the command needs to be executable by only Super administrators, here is the directory: Anarchy/gamemode/base/sh_objects/items/sh_weapon_*.lua Thanks, ahead of time, its rather easy to do, i just forget how =/ and im beyond terrible with the wiki. If you want to add a concommand for it, make it /listshweapon.
[lua]concommand.Add("listshweapon", function(Ply) if (Ply:IsSuperAdmin()) then for k,v in pairs(file.FindInLua("Anarchy/gamemode/base/sh_objects/items/sh_weapon_*.lua")) do Ply:PrintMessage(HUD_PRINTCONSOLE, v) end end end)[/lua] Then type "listshweapon" in console to get a list.
Thankyou robbis, appreciate it [editline]10:23AM[/editline] robbis is that very last end statement suppose to have a ) ?
[QUOTE=schumacher;17139757]Thankyou robbis, appreciate it [editline]10:23AM[/editline] robbis is that very last end statement suppose to have a ) ?[/QUOTE] Yes.
To add to FlapJack's yes, it closes the concommand.Add function, since the function is just one of the arguments.
Sorry, you need to Log In to post a reply to this thread.