Hi, I haven’t found the solution to Awaiting scripts screen stuck.
Previously I used to write code for ANOTHER MP but now have decided to change the platform as more prospect.
On first connection to server I have bridge screen (events playerConnecting & playerJoining work)
then I do recconect via F8 and get this (events playerConnecting & playerJoining DONT work)
CitizenFX.log
CitizenFX_log_2021-08-15T183447.log (224.9 KB)
Server shows no errors. Idk how to fix this.
nta
August 15, 2021, 7:31pm
2
Run ShutdownLoadingScreen()
on client.
Can U tell how to get current player?
In another mp project player was the first argument of every event and server-build function but here it’s kinda weird as for me.
Wrote this
on(`playerJoining`, (targetPlayer) => {
try
{
info(`playerJoining`, 'Connected');
emitNet("shutdownLoading", targetPlayer);
}
catch (e)
{
error(`playerJoining`, e);
}
});
on client
on(`shutdownLoading`, () => {
ShutdownLoadingScreen();
});
No effect because on client it should be
onNet(`shutdownLoading`, () => {
ShutdownLoadingScreen();
});
nta
August 15, 2021, 7:47pm
4
I am not sure if events get queued for client to run when they finish loading, playerJoining
is triggered when they start loading.
You can just run ShutdownLoadingScreen() in top-level code.
Made some work and got it
I suppose I have to spawn player now?
What is the name of event when everything is ready for spawning?
Could You please be so kind to tell it?
It means that spawnmanager is not ready yet?
Is it okay that spawnmanager is written in LUA but I write in JS?
Also I get this after a while
1 Like
nta
August 16, 2021, 6:42am
6
Ah, I forgot to mention DoScreenFadeIn as well.
There is none, client scripts just don’t run until this is the case.
Yes, however spawnmanager currently doesn’t have any server-side exports. I’m not sure why, maybe nobody asked for these before?
Are you running the server locally? Seems like something you’re doing is freezing the server.
I know what’s going on, because you need to start a resource called “basic-gamemode” after “spawnmanager”
ensure spawnmanager
ensure basic-gamemode
or
put the following script in other client.lua (But the first method is recommended)
AddEventHandler('onClientMapStart', function()
exports.spawnmanager:setAutoSpawn(true)
exports.spawnmanager:forceRespawn()
end)
Then restart your server, enjoys!
2 Likes