Quick question on rcon

How can i make 2 rcon commands execute once the server is all started up?

Pretty sure it’s:

ExecuteCommand('yourCommandHere')

Assuming that goes in server.cfg after resources?

No, you need to make a resource that does that for you. You can either create a delay or you can make sure that the resource that holds that code is started last.

It must be executed on a server script

Im assuming i cant just add that in a server.lua and add it in resource.lua. Could you help me out with this not too good in scripting. Dont wanna bug you though if you cant its no problem.

__resource.lua

resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
server_script 'server.lua'

server.lua (without delay)

ExecuteCommand('yourCommandHere')
ExecuteCommand('yourCommandHere')

If you want to have a delay use this server.lua instead:

Citizen.CreateThread(function()
    Citizen.Wait(5000) -- waits 5 seconds.
    ExecuteCommand('yourCommandHere')
    ExecuteCommand('yourCommandHere')
end)

server.cfg

# start all your other resources first, then after that start your new script
start <ExecuteCommandScriptNameHere>

Appreciate it thank you!

1 Like

So i did that and made it execute traffic 0.1 and crowd 0.1 just like that where it said to enter the rcon commands. Its delayed until after restart and its at the end of server.cfg but when it runs commands it says uknown. If i do it manually it says command found and works. Not sure why

What command did you enter? Show me the file please.

Citizen.CreateThread(function()
Citizen.Wait(5000) – waits 5 seconds.
ExecuteCommand(‘traffic 0.1’)
ExecuteCommand(‘crowd 0.1’)
end)

Thats whats in the file.

Do you have ACL installed? Or some other resource that has those commands?

ACL, for some reason every restart my settings reset. But i also need to run another rcon command not in that but im gonna try out too.
edit: added other one and i get an access denied while putting in restart frfuel.

Can you show your server.cfg file?

Seems to me like your ACL is pretty much messed up, try re-installing a fresh copy (backup the old one) and see if it works.

Name of resource is rcon https://gyazo.com/fd8c359a42d3fafee61924988f9907b3 and im reinstalling now.

Ive noticed that the 1.0.6 version doesnt load but the github does. Is the github 1.0.6? Im assuming it is just wondering

edit: reinstalled, set traffic to 0.1 and crowd in rcon. I am listed as admin but i cant use any commands in game though.

Alright then, more issues by the minute. Not sure why that admin stuff is broken…

Yeah acl has always been weird for me only. Any reason for rcon script not working on thing non related to acl?
edit: Rcon commands work fully just not in game but idc about that. i just want it to save the traffic and croud settings. Anyway i can set it to 0.1 in the file so it just automatically loads up that way

Don’t have time to help you right now sorry.