diff options
Diffstat (limited to 'gamemode/client/cl_syncronize.lua')
| -rw-r--r-- | gamemode/client/cl_syncronize.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gamemode/client/cl_syncronize.lua b/gamemode/client/cl_syncronize.lua new file mode 100644 index 0000000..32d667c --- /dev/null +++ b/gamemode/client/cl_syncronize.lua @@ -0,0 +1,28 @@ +--Makes sure the player knows about things like inventory, skills, experience ect. + +net.Receive( "gms_SetResource", function( length, pl) + print("Setresources message sent from server") + local name = net.ReadString() + if(GMS.GetResourceByName(name).UniqueData) then + local restable = net.ReadTable() + PrintTable(restable) + if(Resources[name] == nil) then + Resources[name] = {} + end + table.insert(Resources[name],restable.UniqueDataID,restable) + else + if(Resources[name] == nil) then + Resources[name] = 0 + end + print("Getting with bitcount:" .. GMS.NETINT_BITCOUNT) + local num = net.ReadInt(GMS.NETINT_BITCOUNT) + print("Resource name: " .. name) + print("Resource num: " .. num) + Resources[name] = num + end + print("Finished resource get") +end) + +concommand.Add("gms_cl_printresources",function(ply,cmd,args) + PrintTable(Resources) +end) |
