Disable production mode in my server

Hello,

I’m creating a server to play with my friends. It seems that no one can use commands. It says that comand is disable in production mode.
I searched about this production mode and found that it’s possible to get around it by adding an additional argument to the FiveM shortcut.
That solves the problem, but I don’t want to solve it this way. I don’t want to force my friends to have to make local changes to be able to use commands on my server.
I’m currently using txAdmin v4.17.1 (latest recommended). I’m also running the server on my local machine.
Is there a server-side option to take this out of production mode or something?
I recently detected that only the commands in the scripts I made don’t work. The default ESX commands like /car or /heal are working fine.
If you need more information, please let me know.

Thanks!

1 Like

Do you have the code for an example command? Script commands should work fine even on production mode, at least if you’re correctly using RegisterCommand.

Of course! Here:

fxmanifest.lua

fx_version 'cerulean'
game 'gta5'

version 'v1.0.0'

ui_page 'UI/index.html'

files {
    'UI/**.html',
    'UI/**.css',
    'UI/**.js',
    'UI/imgs/**.*'
}

client_scripts {
    'client/**.lua',
    'configs/**.lua'
}

server_script 'server/main.lua'

client/main.lua

--[[ Functions ]]--
function OpenUI()
    SetNuiFocus(true, false)
    SendNUIMessage({ type = 'open' })
end

function CloseUI()
    SetNuiFocus(false, false)
    SendNUIMessage({ type = 'close' })
end

configs/main.lua

_DEBUG = true

if _DEBUG then
    RegisterCommand('test', function(source)
        if source > 0 then return end
        OpenUI()
    end, true)
end

Ah: true means it’s a command that has restricted access, and that doesn’t work for client-side commands. Try false.

It’s likely a bug that this shows the ‘permission denied’ message for ‘non-production builds’ though… :thinking:

Yes! It works! I’m sorry for the dumb question :sweat_smile: but I’m still trying to learn these gta5 natives.
It actually makes sense!
Thanks for the help! :smile:

sorry but in which file you have to do this change???

The change I’ve done was in the RegisterCommand native. You need to set the last variable to false to use it for client-side.

where is this file located? “RegisterCommand native”

Hi ospo! First of all welcome to the comunity :grin:

That is not a file. “RegisterCommand” is a native function from gta. You can find them all here: Native Reference - Cfx.re Docs

Guys I found a more simple solution. Just turn your fivem game from release to beta in settings

Hi there @itspanlam
That might work as well but it’s not ideal if you want to open a public server.

Oh OK, I think you 're right.

where is this file

Hi there!

The files you need to create yourself.
“RegisterCommand” is a native function.