Hi. I used to code in RAGE and now I’m trying in FiveM.
When I try to run a code and it doesn’t work no errors show up in m console. What’s wrong? I get absolutely no feedback in my console
Okay, can you send us a screenshot of your console?
And also, thats good? until you got no errors and put no print/Write in your script as a debug theres nothing really supposed to show up=
If I sent you a screenshot of my console I would be sending you a screenshot of nothing, as there is nothing to see.
The problem is that I have errors because the scripts don’t work most of times, they just aren’t reported.
Okay, your console is empty?
What OS are you (the server) running on?
Are you using something like txAdmin?
The console seems to be working perfectly except for the erros part. It’s not empty, it just doesn’t report the errors.
I am using txAdmin yes. Windows.
I don’t even see any resource running there. 
too hehe 
Please update your server.cfg and add your resource like that:
start (resourcename)
and restart the server 
But there are resources, as I’m using many and they work. Sorry I am just learning. Everything seems ok, but sometimes a script doesn’t work and I would like to know why. I know that in RAGE I used to get feedback from console but that was a year ago and I forgot most things by now.
okay. whats the content of mymode?
Do you have a client lua? A server lua? and the code in it please send this in here too
dont forget resources must have a __resource.lua or fxmanifest.lua in their folder
I’m learning to code so I’m adding all my test scripts to mymode. As of right now I’m working on this one:
RegisterCommand('vida2', async (source, args, raw) => {
let ped = PlayerPedId();
let amount = 100;
let playerName = GetPlayerName(PlayerId());
if (args[0] == null)
{
emit('chat:addMessage', {
args: [`Teste!`]
});
SetEntityHealth(ped, amount);
}
else
{
ped = GetPlayerPed(args[0]);
let playerIdentifier = GetPlayerIdentifier(args[0]);
SetEntityHealth(ped, amount);
emit('chat:addMessage', {
args: [`The player name is ${playerName}!`]
});
}
}, false);
There is a problem with GetPlayerIdentifier (I didn’t add the second parameter), but it isn’t showing up in console
The rest of the code (it’s working)
Delay = (ms) => new Promise(res => setTimeout(res, ms)); const spawnPos = [-275.522, 6635.835, 7.425]; on('onClientGameTypeStart', () => { exports.spawnmanager.setAutoSpawnCallback(() => { exports.spawnmanager.spawnPlayer({ x: spawnPos[0], y: spawnPos[1], z: spawnPos[2], model: 'a_m_m_skater_01' }, () => { emit('chat:addMessage', { args: [ 'Welcome to the party!~' ] }) }); }); exports.spawnmanager.setAutoSpawn(true) exports.spawnmanager.forceRespawn() }); RegisterCommand('colete', async (source, args, raw) => { let ped = PlayerPedId(); let amount = 100; if (args.length > 0) { amount = parseInt(args[0]); } SetPedArmour(ped, amount); emit('chat:addMessage', { args: [`O teu colete foi definido para ^*${amount}!`] }); }, false); RegisterCommand('vida', async (source, args, raw) => { let ped = PlayerPedId(); let amount = 100; if (args.length > 0) { amount = parseInt(args[0]); } SetEntityHealth(ped, amount); emit('chat:addMessage', { args: [`A tua vida foi definida para ^*${amount}!`] }); }, false); RegisterCommand('vida2', async (source, args, raw) => { let ped = PlayerPedId(); let amount = 100; let playerName = GetPlayerName(PlayerId()); if (args[0] == null) { emit('chat:addMessage', { args: [`Teste!`] }); SetEntityHealth(ped, amount); } else { ped = GetPlayerPed(args[0]); let playerIdentifier = GetPlayerIdentifier(args[0]); SetEntityHealth(ped, amount); emit('chat:addMessage', { args: [`The player name is ${playerName}!`] }); } }, false); RegisterCommand('teleportar', async (source, args, raw) => { let ped = PlayerPedId(); StartPlayerTeleport(ped, 1000, 1000, 0, 10, true, true, true); }, false); RegisterCommand('criarped', async (source, args, raw) => { RequestModel(0x9A1E5E52); CreatePed(2, 0x9A1E5E52, -275.522, 6635.835, 7.425, 0.0, true, true); }, false); RegisterCommand('procurado', async (source, args, raw) => { let ped = PlayerPedId(); wantedLevel = args[0]; SetPlayerWantedLevel(source, parseInt(wantedLevel), false); emit('chat:addMessage', { args: [`O teu nível de procurado foi definido para ^*${wantedLevel}!`] }); }, false); RegisterCommand('veiculo', async (source, args, raw) => { // account for the argument not being passed let model = "adder"; if (args.length > 0) { model = args[0].toString(); } // check if the model actually exists const hash = GetHashKey(model); if (!IsModelInCdimage(hash) || !IsModelAVehicle(hash)) { emit('chat:addMessage', { args: [`^*${model} não existe.`] }); return; } // Request the model and wait until the game has loaded it RequestModel(hash); while (!HasModelLoaded(hash)) { await Delay(500); } const ped = PlayerPedId(); // Get the coordinates of the player's Ped (their character) const coords = GetEntityCoords(ped); // Create a vehicle at the player's position const vehicle = CreateVehicle(hash, coords[0], coords[1], coords[2], GetEntityHeading(ped), true, false); // Set the player into the drivers seat of the vehicle SetPedIntoVehicle(ped, vehicle, -1); // Allow the game engine to clean up the vehicle and model if needed SetEntityAsNoLongerNeeded(vehicle); SetModelAsNoLongerNeeded(model); // Tell the player the car spawned emit('chat:addMessage', { args: [`Woohoo! Enjoy your new ^*${model}!`] }); }, false); RegisterCommand('arma', async (source, args, raw) => { let model = "weapon_pistol_mk2" let ammoCount = 999 const ped = PlayerPedId(); GiveWeaponToPed(ped, 0xC1B3C3D1, ammoCount, false, true) }, false);
This is client sided. And the console is only showing server sided issues etc.
Press F8 Ingame to reval client console
Can you try removing the ‘async’?
Thank you!
This didn’t work but D4NE gave me an answer already


