Run ULX console commands every 5 Mins

Hello,

Can someone write me a line or two of code to run these ULX commands every 5 mins please. Also would this print it in chat as that is what I would like to see (CONSOLE Freezed props etc.)

Commands:

  • “ulx cleardecals”
  • “ulx clearragdolls”
  • “ulx freezeprops”
  • “ulx stopsound”
  • “FPP_Cleanup disconnected”

Kind Regards,
Psycho Fanny

Someone here’ll write you the code when they really shouldn’t because it means you don’t learn anything but until that happens I’m gonna tell you to look into timer.Create’s page on the gmod wiki, a k,v pairs loop to run it on everyone and :ConCommand(“string”)

I agree but I prefer to read how other people code and then acknowledge that.

[spoon]



timer.Create("psycho_cleanup_timer", 300, 0, function()
    RunConsoleCommand("ulx", "cleardecals")
    -- Add the rest..
end)


[/spoon]



local commands = {
    "ulx cleardecals",
    "You do the rest",
}

local function DoCleanup()
    for _, cmd in pairs(commands) do
        game.ConsoleCommand(cmd .. "
")
    end
end

timer.Create("CronCleanup", 5 * 60, 0, DoCleanup)


[EDITLINE][/EDITLINE]
Wow. Editing mobile is hard, top post beat me by 6 minutes

This is a forum, not a letter for the queen.

You can create a PHP-script which uses RCON to execute commands, put it in crontab and enjoy. Not really the smart way tho.

Yeah and next time you see a spider in the shower you can call the white house and request a nuke on your house. Not really the smart way tho.