mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-16 03:07:34 +00:00
use custom value
This commit is contained in:
parent
bfdda46882
commit
1ad34a0635
|
@ -37,6 +37,14 @@ function gmInte.playerConnect(data)
|
||||||
gmInte.post("/server/user/connect", data)
|
gmInte.post("/server/user/connect", data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function getCustomValues(ply)
|
||||||
|
local customValues = {}
|
||||||
|
|
||||||
|
customValues.money = ply:gmInteGetTotalMoney() || 0
|
||||||
|
|
||||||
|
return customValues
|
||||||
|
end
|
||||||
|
|
||||||
local function getTriggerInfo(text)
|
local function getTriggerInfo(text)
|
||||||
for k, v in pairs(gmInte.config.chatTrigger) do
|
for k, v in pairs(gmInte.config.chatTrigger) do
|
||||||
if (string.StartWith(text, k)) then
|
if (string.StartWith(text, k)) then
|
||||||
|
@ -152,7 +160,7 @@ function gmInte.playerDisconnected(ply)
|
||||||
["steam"] = ply:SteamID64(),
|
["steam"] = ply:SteamID64(),
|
||||||
["kills"] = ply:Frags() || 0,
|
["kills"] = ply:Frags() || 0,
|
||||||
["deaths"] = ply:Deaths() || 0,
|
["deaths"] = ply:Deaths() || 0,
|
||||||
["money"] = ply:gmInteGetTotalMoney() || 0,
|
["customValues"] = getCustomValues(ply),
|
||||||
["rank"] = ply:GetUserGroup() || "user",
|
["rank"] = ply:GetUserGroup() || "user",
|
||||||
["time"] = os.difftime(os.time(), ply.gmIntTimeConnect) || 0,
|
["time"] = os.difftime(os.time(), ply.gmIntTimeConnect) || 0,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user