Im trying to update these network functions but I'm pretty new to gmod lua and I haven't even began to touch networking yet, would someone be able to help me with this?
function AccessorFuncNW( tab, varname, name, varDefault, iForce )
tab[ "Get"..name ] = function ( self ) return self:GetNetworkedVar( varname, varDefault ) end
if ( iForce == FORCE_STRING ) then
tab[ "Set"..name ] = function ( self, v ) self:SetNetworkedVar( varname, tostring(v) ) end
return end
if ( iForce == FORCE_NUMBER ) then
tab[ "Set"..name ] = function ( self, v ) self:SetNetworkedVar( varname, tonumber(v) ) end
return end
if ( iForce == FORCE_BOOL ) then
tab[ "Set"..name ] = function ( self, v ) self:SetNetworkedVar( varname, tobool(v) ) end
return end
tab[ "Set"..name ] = function ( self, v ) self:SetNetworkedVar( varname, v ) end
end
Can someone please help me with this I have been trying and Im at a loss.
Sorry, you need to Log In to post a reply to this thread.