diff options
| author | Scott <scotth0828@gmail.com> | 2016-05-03 14:38:36 -0400 |
|---|---|---|
| committer | Scott <scotth0828@gmail.com> | 2016-05-03 14:38:36 -0400 |
| commit | 9fb69ba8eef9dd3d2f922d98588286df98c0cf08 (patch) | |
| tree | 09d923b778b7a1b838001cc53c4e6c35b103fe99 | |
| parent | e2fc0bfe5beea9b2a2966eb94287d106649d8f2b (diff) | |
| download | gmstranded-9fb69ba8eef9dd3d2f922d98588286df98c0cf08.tar.gz gmstranded-9fb69ba8eef9dd3d2f922d98588286df98c0cf08.tar.bz2 gmstranded-9fb69ba8eef9dd3d2f922d98588286df98c0cf08.zip | |
Updated gravestone
| -rw-r--r-- | gamemode/cl_deathmenu.lua | 52 | ||||
| -rw-r--r-- | gamemode/init.lua | 4 |
2 files changed, 29 insertions, 27 deletions
diff --git a/gamemode/cl_deathmenu.lua b/gamemode/cl_deathmenu.lua index 0dffb59..6b023eb 100644 --- a/gamemode/cl_deathmenu.lua +++ b/gamemode/cl_deathmenu.lua @@ -163,7 +163,10 @@ function PANEL:Init() end local tbl1 = string.Split(res[k], " ") - local tbl2 = string.Split(tbl1[2], "x") + local tbl2 = string.Split(tbl1[#tbl1], "x") + local ntbl = tbl1 + table.remove(ntbl) + rName = string.Implode(" ", ntbl) local amount = tbl2[2] resPNL.DoClick = function() @@ -177,8 +180,8 @@ function PANEL:Init() for i,o in pairs(res) do spl1 = string.Split(v, " ") spl2 = string.Split(o, " ") - if (spl1[1] == spl2[1]) then - giveRes(tbl1[1], 1, i) + if (spl1[#spl1] == spl2[#spl2]) then + giveRes(rName, 1, i) table.remove(res,i) end end @@ -188,11 +191,12 @@ function PANEL:Init() for i,o in pairs(res) do + spl1 = string.Split(v, " ") spl2 = string.Split(o, " ") - if (spl1[1] == spl2[1]) then - giveRes(tbl1[1], 1, i) - res[i] = tbl1[1] .. " x" .. amount + if (spl1[#spl1] == spl2[#spl2]) then + giveRes(rName, 1, i) + res[i] = rName .. " x" .. amount v = res[i] end end @@ -211,8 +215,8 @@ function PANEL:Init() for i,o in pairs(res) do spl1 = string.Split(v, " ") spl2 = string.Split(o, " ") - if (spl1[1] == spl2[1]) then - giveRes(tbl1[1], 5, i) + if (spl1[#spl1] == spl2[#spl2]) then + giveRes(rName, 5, i) table.remove(res, i) end end @@ -228,9 +232,8 @@ function PANEL:Init() for i,o in pairs(res) do spl1 = string.Split(v, " ") spl2 = string.Split(o, " ") - if (spl1[1] == spl2[1]) then - giveRes(tbl1[1], num2, i) - print(i) + if (spl1[#spl1] == spl2[#spl2]) then + giveRes(rName, num2, i) table.remove(res,i) end end @@ -243,9 +246,9 @@ function PANEL:Init() for i,o in pairs(res) do spl1 = string.Split(v, " ") spl2 = string.Split(o, " ") - if (spl1[1] == spl2[1]) then - giveRes(tbl1[1], 5, i) - res[i] = tbl1[1] .. " x" .. amount + if (spl1[#spl1] == spl2[#spl2]) then + giveRes(rName, 5, i) + res[i] = rName .. " x" .. amount v = res[i] end end @@ -263,8 +266,8 @@ function PANEL:Init() for i,o in pairs(res) do spl1 = string.Split(v, " ") spl2 = string.Split(o, " ") - if (spl1[1] == spl2[1]) then - giveRes(tbl1[1], 10, i) + if (spl1[#spl1] == spl2[#spl2]) then + giveRes(rName, 10, i) table.remove(res, i) end end @@ -279,8 +282,8 @@ function PANEL:Init() for i,o in pairs(res) do spl1 = string.Split(v, " ") spl2 = string.Split(o, " ") - if (spl1[1] == spl2[1]) then - giveRes(tbl1[1], num2, i) + if (spl1[#spl1] == spl2[#spl2]) then + giveRes(rName, num2, i) table.remove(res,i) end end @@ -295,9 +298,9 @@ function PANEL:Init() for i,o in pairs(res) do spl1 = string.Split(v, " ") spl2 = string.Split(o, " ") - if (spl1[1] == spl2[1]) then - giveRes(tbl1[1], 10, i) - res[i] = tbl1[1] .. " x" .. amount + if (spl1[#spl1] == spl2[#spl2]) then + giveRes(rName, 10, i) + res[i] = rName .. " x" .. amount v = res[i] end end @@ -311,8 +314,8 @@ function PANEL:Init() for i,o in pairs(res) do spl1 = string.Split(v, " ") spl2 = string.Split(o, " ") - if (spl1[1] == spl2[1]) then - giveRes(tbl1[1], amount, i) + if (spl1[#spl1] == spl2[#spl2]) then + giveRes(rName, amount, i) amount = 0 table.remove(res,i) end @@ -348,9 +351,8 @@ function PANEL:Close() end function giveRes(res, amount, slot) - - net.Start('givePlayerResource') + net.Start('givePlayerResource') net.WriteString(res) net.WriteInt(amount, 32) net.WriteInt(slot, 32) diff --git a/gamemode/init.lua b/gamemode/init.lua index b28219a..2d15d1f 100644 --- a/gamemode/init.lua +++ b/gamemode/init.lua @@ -80,7 +80,7 @@ net.Receive('givePlayerResource', function(len, ply) local resSlot = net.ReadInt(32) local restbl = ply:GetEyeTrace().Entity.deathResources local tbl1 = string.Split(restbl[resSlot], " ") - local tbl2 = string.Split(tbl1[2], "x") + local tbl2 = string.Split(tbl1[#tbl1], "x") local amt = tbl2[2] ply:IncResource( ResToGive, Amount ) @@ -90,7 +90,7 @@ net.Receive('givePlayerResource', function(len, ply) table.remove(restbl, resSlot) else amt = amt - Amount - restbl[resSlot] = tbl1[1] .. " x" .. amt + restbl[resSlot] = ResToGive .. " x" .. amt end |
