blob: 189dd085a6167489a2e97efeeab91da5823d2ea4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
--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")
GAMEMODE:ReloadSpawnMenu()
end)
concommand.Add("gms_cl_printresources",function(ply,cmd,args)
PrintTable(Resources)
end)
|