I've been trying to figure out a way to send information from the server to the player as soon as it's possible. I've tried doing timer.Simple(0, sending a message to the server and back, but that's not early enough. Anyone have any alternatives to PlayerInitialSpawn, or another method to send information to the client from the server as soon as possible?
Thanks a lot
Earlier than PlayerInitialSpawn? What are you trying to network?
Have you tried GM/PlayerAuthed?
PlayerAuthed is actually after PlayerInitialSpawn, thanks tho
Ill give that a shot, but I think ive tried it. Thanks
The best way to accomplish what you want is for the client to ping the server on InitPostEntity, and have the server start networking things only after it has received that message.
That works, but I need the data sent to the client before the loadCustomDarkRPItems hook. An alternative for me is to override the hook and delay it or something along those lines, but I feel like that should be the last thing to try :P
What's your actual goal? If we know more about what you're trying to do we may be able to help better.
sorry if the question is a little vague
I have a table of jobs stored on the server that I want sent to the client and registered. this table is dynamic which is why its stored on the server instead of shared.
Thanks
You should be able to add your jobs outside of that hook anyway, or at least I don't figure it would cause any problems. The one thing you have to be sure to do is make sure that all the same jobs are created in the same order on the server and across all the clients.
So you are looking for something like this [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/CreateTeams]GM:CreateTeams[/url]
Someone posted this hack:
hook.Add("HUDPaint", "AmILoadedYet?", function()
net.Start("Iam!")
net.SendToServer()
hook.Remove("HUDPaint", "AmILoadedYet?")
end)
So basically HUDPaint doesn't get called until you're loaded and all fine, that's when we could send the message to the server pinging it that we are ready. (Watch out, it might get sent multiple times), and then straight after sending that message we remove the hook.
I have no idea where I saw someone doing stuff like that, but it seems alright.
Never do dis. InitPostEntity is the earliest that you can reliably depend on the client being ready to receive information, and it's sort of meant for situations like this, whereas the hook meant for drawing things on-screen is not.
ight thanks yall I got it working
Sorry, you need to Log In to post a reply to this thread.