summaryrefslogtreecommitdiff
path: root/gamemode/cl_deathmenu.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/cl_deathmenu.lua')
-rw-r--r--gamemode/cl_deathmenu.lua52
1 files changed, 27 insertions, 25 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)