So, my friends and I have been working on a TDM gamemode lately it was all fine until, we encoutered trouble with the loadout menu. (someone changed it)
Now even thought the net message is pooled serverside. the game still says its not.
[CODE]
[ERROR] gamemodes/tdm/gamemode/cl_loadout.lua:150: Calling net.Start with unpooled message name! [http://goo.gl/qcx0y]
1. Start - [C]:-1
2. unknown - gamemodes/tdm/gamemode/cl_loadout.lua:150
[/CODE]
on line 150 in cl_loadout.lua
[CODE] net.Start( "RequestWeapons" )
net.SendToServer()
local received = false[/CODE]
in sv_loadout(the server side script) yes its included inside init.lua
[CODE]
util.AddNetworkString( "RequestWeapons" )
util.AddNetworkString( "RequestWeaponsCallback" )
(weapon tables are here)
net.Receive( "RequestWeapons", function( len, ply )
net.Start( "RequestWeaponsCallback" )
net.WriteTable( primaries )
net.WriteTable( secondaries )
net.Send( ply )
end )
[/CODE]
Anybody understands our problem?
try put AddNetworkString in same file as net.Start instead of server file
I've noticed that some functions may have trouble to run properly, if they're ran early at the top of a script.
That's just something that I've encountered, so I don't know if that's it..
[QUOTE=nurwe;51028888]try put AddNetworkString in same file as net.Start instead of server file[/QUOTE]
[URL="http://wiki.garrysmod.com/page/Calling_net.Start_with_unpooled_message_name"]Wiki says to put it serverside[/URL], clientside would just make it not work
[editline]10th September 2016[/editline]
[QUOTE=Jompe...;51028908]I've noticed that some functions may have trouble to run properly, if they're ran early at the top of a script.
That's just something that I've encountered, so I don't know if that's it..[/QUOTE]
What do you mean?
[QUOTE=Marmigamed;51028923][URL="http://wiki.garrysmod.com/page/Calling_net.Start_with_unpooled_message_name"]Wiki says to put it serverside[/URL], clientside would just make it not work
[editline]10th September 2016[/editline]
What do you mean?[/QUOTE]
What I mean is that, when you run a function early, at the top of the script. Where the client/server just have started reading it. Then the client/server may have problems to execute the function that you ask it to run. As an example, I don't think that anything will happend if you run vgui.Create at the first line.
[B]I'm just doing a wild guess here, as I've encountered this problem before.[/B]
[CODE]if SERVER then util.AddNetworkString( "RequestWeapons" ) util.AddNetworkString( "RequestWeaponsCallback" ) end[/CODE]
you need to define it serverside, like this.
thank me later
[QUOTE=Marmigamed;51028923][URL="http://wiki.garrysmod.com/page/Calling_net.Start_with_unpooled_message_name"]Wiki says to put it serverside[/URL], clientside would just make it not work
[editline]10th September 2016[/editline]
What do you mean?[/QUOTE]
Are you sure the serverside code is loading?
This was happening to me the other day until i realised the serverside code wasnt loading on a linux machine because of the files and folders having mayus letters. Try lowering all the letters from the files and putting a print outside of everything and seeing if that prints in the console. If it doesnt the serverside code isnt loading at all.
[editline]11th September 2016[/editline]
[QUOTE=cudex;51029043][CODE]if SERVER then util.AddNetworkString( "RequestWeapons" ) util.AddNetworkString( "RequestWeaponsCallback" ) end[/CODE]
you need to define it serverside, like this.
thank me later[/QUOTE]
u fucking wot m8?
He is doing everything right as it seems, and u come up being a cocky shit like this?
Just... Get out of here.
[QUOTE=Jompe...;51028999]What I mean is that, when you run a function early, at the top of the script. Where the client/server just have started reading it. Then the client/server may have problems to execute the function that you ask it to run. As an example, I don't think that anything will happend if you run vgui.Create at the first line.
[B]I'm just doing a wild guess here, as I've encountered this problem before.[/B][/QUOTE]
Why would only a portion of the script be loaded doesn't make sense.
[QUOTE=cudex;51029043][CODE]if SERVER then util.AddNetworkString( "RequestWeapons" ) util.AddNetworkString( "RequestWeaponsCallback" ) end[/CODE]
you need to define it serverside, like this.
thank me later[/QUOTE]
I don't need to define it as server side since its not a shared file.
[QUOTE=geferon;51031506]Are you sure the serverside code is loading?
This was happening to me the other day until i realised the serverside code wasnt loading on a linux machine because of the files and folders having mayus letters. Try lowering all the letters from the files and putting a print outside of everything and seeing if that prints in the console. If it doesnt the serverside code isnt loading at all.[/QUOTE]
We are running on windows, so I don't think that mayus letters are an issue :/
But will try it :) tho it would be weird that an included code, doesn't load..
Sorry for late reply, I was out to work.
Sorry, you need to Log In to post a reply to this thread.