Gmod Net messages error HELP!

Hello! i keep getting this error and i dont know how to fix it! Any help is greatly appreciated!

clientside code:


local _cdb_y = vgui.Create( "DButton", _mdcb )
		_cdb_y:SetFont( "Default" )
		_cdb_y:SetText( "YES" )
		_cdb_y:SetTextColor( Color( 0, 0, 0 ) )
		_cdb_y:SetPos( 45, 75 )
		_cdb_y:SetSize( 100, 30 )
		_cdb_y.Paint = function( self, w, h )
			draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 255, 0, 255 ) )
		end
		

				_cdb_y.DoClick = function() 
		
				net.Start("_sk_m_ns") --THIS IS THERE IT IS ERRORING
				net.WriteInt( _s_kp , 32)
				net.SendToServer()
		
				_mdcb:Close();
				end

serverside code:


include("skconfig.lua")
if SERVER then end



util.AddNetworkString("_sk_m_ns")




net.Receive("_sk_m_ns", function(len, ply)
end

error: 292.Calling net.Start with unpooled message name!

its erroring on the net.start.
Thanks in advance!

Check the if statement in your serverside code. You’re just ending it and the networkstring must be declared on the server.

I thought you only needed the util.AddNetworkMessage on the server side?

Also I used this exact same code earlier and it worked like a charm idk what’s wrong

if SERVER then end

You don’t need this, remove it.

[editline]28th July 2016[/editline]

Make sure your serverside file is actually included.

Thanks for the reply! I will try that fix asap. Regarding including the server file would I include(“svfile.lua”) in the clientside or where? Thanks again!

You would include it in your init if it’s a gamemode, or just serverside from autorun/server.

Sorry but I’m confused… I would include the server file in the server side?

You include it in the server side autorun folder.

Guys, can we please stop providing support to people who post in the wrong section and instead redirect them to the correct section?

It’s the mods’ job to move threads/ban for posting in the wrong section. You can PM them or report the thread. People posting multiple threads just adds more clutter.

[editline]29th July 2016[/editline]

Niandra even said it in the thread you linked:

Sorry for any inconvenience I have cause as I have only been on this site for a few days! I will be sure to try and use the correct section from this point forward! Sorry and thanks for the info!

Yes, however the person below him said bans will be given out simply for replying. I’m happy to risk a ban if it means I’m educating the user instead of just banning them for making a mistake.

Your really going to ban me because I was ill informed as to where to post? Also I just apologized for any wrongdoing and said I would be sure to post in the right place next time…

No, I’m not going to ban anyone. I can’t ban anyone. What the moderators do with their powers, however, is another story. They are VERY strict.

What I meant was I’d rather risk my own ban than have a moderator come and ban you for something as undescriptive as “wrong section”, without telling you why its the wrong section and where the right section is.

Not if you report it regardless.

I will make sure I post in the right place next time but I still have a question about my code. Where would I include the server file?

Is it for a gamemode?

No. I’m making a derma panel that opens when you type !sell in chat and the derma has a button and when you click it it will add money. It’s just a test script for a larger plan… Like a proof of concept

Then put the file in lua/autorun/server

this is my clientside



		local _cdb_y = vgui.Create( "DButton", _mdcb )
		_cdb_y:SetFont( "Default" )
		_cdb_y:SetText( "YES" )
		_cdb_y:SetTextColor( Color( 0, 0, 0 ) )
		_cdb_y:SetPos( 45, 75 )
		_cdb_y:SetSize( 100, 30 )
		_cdb_y.Paint = function( self, w, h )
			draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 255, 0, 255 ) ) -- Draw an red button
		end
		

				_cdb_y.DoClick = function() 
		
				net.Start("_sk_m_ns")--- DO NOT CHANGE
			        net.WriteInt( _s_kp , 32)
				net.SendToServer()--- DO NOT CHANGE
		
				_mdcb:Close();
				end

and serverside


include("skconfig.lua")

util.AddNetworkString("_sk_m_ns")

net.Receive("_sk_m_ns", function(len, ply)

	if(string.find(ply:GetActiveWeapon():GetClass(),"csgo_")) then
	
	
	

local function GetPrice(len,ply)

		local _f_kp = net.ReadInt(32)

		
			local curr_class = ply:GetActiveWeapon():GetClass()
			ply:StripWeapon(ply:GetActiveWeapon():GetClass())
			
			ply:ChatPrint( "You sold your "..curr_class.." for $ ".._f_kp.."!" );
			
			ply:addMoney(_f_kp)
			
			print( "Player "..ply:Nick().." Just Sold A "..curr_class.." For ".._f_kp.."$!" )
			
			else
			
			ply:ChatPrint( "You must be holding a knife to sell it!" );

			ply:ChatPrint( "Try Again!" );
 
			end
	end
	
end)

you have to be holding a csgo knife for it to work

the client is in addons/skmenu/lua/autorun/client
and server is in addons/skmenu/lua/autorun/server
config is in lua/autorun