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.
Signature
void EXECUTE_COMMAND(char* commandString);Parameters
| Name | Type | Description |
|---|---|---|
commandString | char* | — |
Returns void
Description
Depending on your use case you may need to use add_acl resource. to use this native in your resource.
Usage
ExecuteCommand(commandString)
-- always works, by hash
Citizen.InvokeNative(0x561c060b, commandString)JavaScript and C#
ExecuteCommand(commandString);
// by hash
Citizen.invokeNative('0x561c060b', commandString);Function.Call((Hash)0x561c060b, commandString);Examples
Citizen.CreateThread(function()
-- stop the server after 1 minute
Citizen.Wait(60000)
ExecuteCommand("quit Shortlived")
end)Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.