Hello all. I am wondering if anyone knows of any way to access the Citizen. functions and natives. Take this code for example:
onNet('BASE:ReceiveConfig', function(cfg) {
console.log(cfg.Name)
Config = cfg;
var id = GetPlayerServerId(GetPlayerPed(-1))
setImmediate(() => {
Citizen.InvokeNative(GetHashKey("ADD_TEXT_ENTRY"), 'FE_THDR_GTAO', Config.Name+'ID: ~w~'+id)
SetAudioFlag("LoadMPData", true)
SetAudioFlag("WantedMusicDisabled", Config.DisableWantedMusic)
});
});
I currently get this error:
^1Error: Unhandled error: TypeError: Citizen.InvokeNative is not a function
TypeError: Citizen.InvokeNative is not a function
at setImmediate (client.js:36:13)
at Object.callback (citizen:/scripting/v8/timer.js:56:6)
at onTick (citizen:/scripting/v8/timer.js:80:27)^7
Does anyone know how to get around this?
Update, I was a little stupid. See answer for anyone else’s reference: