RedM Natives

EXECUTE_COMMAND

Depending on your use case you may need to use add_acl resource.<your_resource_name command.<command_name allow to use this native in your resource.

Hash0x561C060B
Runtime nameExecuteCommand
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

void EXECUTE_COMMAND(char* commandString);

Parameters

NameTypeDescription
commandStringchar*—

Returns void

Description

Cfx.re native reference

Depending on your use case you may need to use add_acl resource. command. allow to use this native in your resource.

Usage

Lua
ExecuteCommand(commandString)

-- always works, by hash
Citizen.InvokeNative(0x561c060b, commandString)
JavaScript and C#
JavaScript
ExecuteCommand(commandString);

// by hash
Citizen.invokeNative('0x561c060b', commandString);
C#
Function.Call((Hash)0x561c060b, commandString);

Examples

LUA · Cfx.re native reference
Citizen.CreateThread(function()
  -- stop the server after 1 minute
  Citizen.Wait(60000)
  ExecuteCommand("quit Shortlived")
end)

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.