Question for developers, really simple

Is it possible to create a fivem script that prints something when all resources are loaded in? and if so someone might help me make it?

Thanks !

Uh, this would be pretty convoluted, what’s the use case? I.e., what are you trying to do that requires this kind of functionality?

I guess you could make a 4 line script

Check if the players has loaded in the server. If he has then this means that the resources have loaded. I think that is what you are looking for if not let me know.

Below is the client.lua
while not NetworkIsPlayerActive(PlayerPedId()) do
Wait(100);
end
print(“…”)

Also create an fxmanifest file and you are done
fxmanifest.lua:
fx_version ‘cerulean’
game ‘gta5’

client_script ‘client.lua’

From this angle, most “common” frameworks (ESX, QB etc) have their own functionality that hooks into the game events to tell when a player loads in, which is considerably better performance-wise - just an FYI. May be worth a look.

Hey, is it possible to make it so a resource is not useable unless it has a name that i configure it to be?
And thanks, helped a lot.

Yes go to the resource’s client.lua and write
if GetCurrentResourceName == “the name you want” then
Here all the code
end

Do the same for the server.lua. Maybe do it on config.lua as well this is dependent on the script