• Need help with ulx command
    5 replies, posted
Hello friends i just am in need of some help. I would like to run "ulx cleardecals" on a 5 second timer, but unfortunately i do not know the code to use nor where to put it if i had it. Can i get some help please<
Make a ulx shared module and put that code: [code]function ulx.cleardecals( calling_ply ) timer.Simple( 5, function() for k, v in pairs ( player.GetAll() ) do v:ConCommand( "r_cleardecals" ) end end ) end local cleardecals = ulx.command( "Utility", "ulx cleardecals", ulx.cleardecals, "!cleardecals" ) cleardecals:defaultAccess( ULib.ACCESS_ADMIN ) cleardecals:help( "Clears all decals." )[/code] That should do. You will see cleardecals in Utility.
[QUOTE=SleepyMode;52310659]Make a ulx shared module and put that code: [code]function ulx.cleardecals( calling_ply ) timer.Simple( 5, function() for k, v in pairs ( player.GetAll() ) do v:ConCommand( "r_cleardecals" ) end end ) end local cleardecals = ulx.command( "Utility", "ulx cleardecals", ulx.cleardecals, "!cleardecals" ) cleardecals:defaultAccess( ULib.ACCESS_ADMIN ) cleardecals:help( "Clears all decals." )[/code] That should do. You will see cleardecals in Utility.[/QUOTE] Thank you so much [editline]4th June 2017[/editline] [QUOTE=SleepyMode;52310659]Make a ulx shared module and put that code: [code]function ulx.cleardecals( calling_ply ) timer.Simple( 5, function() for k, v in pairs ( player.GetAll() ) do v:ConCommand( "r_cleardecals" ) end end ) end local cleardecals = ulx.command( "Utility", "ulx cleardecals", ulx.cleardecals, "!cleardecals" ) cleardecals:defaultAccess( ULib.ACCESS_ADMIN ) cleardecals:help( "Clears all decals." )[/code] That should do. You will see cleardecals in Utility.[/QUOTE] that actually did not work, damn
You could just edit the default cleardecals code. But this should have also worked - Where did you put that code?
Hey there, the code needs to go into addons/ulx/lua/ulx/modules/sh/cleardecals.lua
[QUOTE=SleepyMode;52311062]Hey there, the code needs to go into addons/ulx/lua/ulx/modules/sh/cleardecals.lua[/QUOTE] There's no point in making a new file and hoping it gets ran after the already-existing file. Just edit the function itself, I believe it's in extended.lua
Sorry, you need to Log In to post a reply to this thread.