Calling net.Start with unpooled message name!, stop working all of a sudden
3 replies, posted
I've checked both server and client sides....I'm adding the util.AD
Server side
[CODE]util.AddNetworkString("spawn_npc1")
net.Receive("spawn_npc1", function(l, ply)
local hit = ply:GetEyeTrace().HitPos
print( "Attempting NPC Spawn" )
local ent = ents.Create("npc_citizen")
ent:SetModel("models/npc/cdc_soldier_npc.mdl")
ent:SetPos(hit)
ent:Spawn()
print(ent:GetModel())
print("Finished NPC Spawn, any luck?")[/CODE]
Client Side
[CODE]Button1 = vgui.Create( "DButton", MainPanel )
Button1:SetSize(200, 100)
Button1:SetPos(10,10,3)
Button1:SetText( "Spawn NPC" )
Button1.DoClick = function ()
net.Start("spawn_npc1")
net.SendToServer()
end[/CODE]
What am I missing here, I am using the right string for the net library? This happened all of a sudden when my internet dropped. Is there something I am missing here that relates to net library? (I've restarted GMOD since.)
Are you sure that the server-side code is being run before the client-side code?
Apparantely there another section farther down that was stopping the cl_init file from being loaded so it was given me an error that was only a symptom and not the problem.
[editline]27th July 2015[/editline]
[QUOTE=LilSumac;48310453]Are you sure that the server-side code is being run before the client-side code?[/QUOTE]
I had to scroll up in console but is there no way to force this? It wasn't given me the direct error as a result and this made it more difficult to find.
If you're talking about a gamemode, then the files for both scopes (client and server) are loaded in the order that you include() them in, starting with the cl_init and init files. If the game hits a compilation error on the way, it will stop where it is and print the error, which means that everything after the error won't be run, resulting in an error which I assume you were describing above.
The only way to stop this is just to be very careful when writing your code and make sure your syntax is correct.
Sorry, you need to Log In to post a reply to this thread.