mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:07:34 +00:00
fix: player verify
This commit is contained in:
parent
6916b91ee7
commit
d77bc64372
|
@ -5,11 +5,14 @@
|
||||||
function gmInte.verifyPlayer(ply)
|
function gmInte.verifyPlayer(ply)
|
||||||
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
||||||
|
|
||||||
gmInte.http.get("/servers/:serverID/players/" .. ply:SteamID64(), function(code, data)
|
gmInte.http.get("/user?steamID64=" .. ply:SteamID64(), function(code, data)
|
||||||
if (!gmInte.config.forcePlayerLink) then return end
|
if (data && data.discordID) then
|
||||||
|
ply.gmIntVerified = true
|
||||||
|
end
|
||||||
|
|
||||||
if (data && data.steamID64) then
|
if (!gmInte.config.forcePlayerLink || !ply.gmIntIsReady) then return end
|
||||||
if (ply.gmIntVerified) then return end
|
|
||||||
|
if (ply:gmIntIsVerified()) then
|
||||||
gmInte.SendNet("chatColorMessage", {
|
gmInte.SendNet("chatColorMessage", {
|
||||||
[1] = {
|
[1] = {
|
||||||
["text"] = "You have been verified",
|
["text"] = "You have been verified",
|
||||||
|
@ -17,7 +20,6 @@ function gmInte.verifyPlayer(ply)
|
||||||
}
|
}
|
||||||
}, ply)
|
}, ply)
|
||||||
ply:Freeze(false)
|
ply:Freeze(false)
|
||||||
ply.gmIntVerified = true
|
|
||||||
else
|
else
|
||||||
gmInte.SendNet("chatColorMessage", {
|
gmInte.SendNet("chatColorMessage", {
|
||||||
[1] = {
|
[1] = {
|
||||||
|
@ -36,7 +38,8 @@ end
|
||||||
//
|
//
|
||||||
|
|
||||||
hook.Add("gmInte:PlayerReady", "gmInte:Verif:PlayerReady", function(ply)
|
hook.Add("gmInte:PlayerReady", "gmInte:Verif:PlayerReady", function(ply)
|
||||||
if (!gmInte.config.forcePlayerLink) then return end
|
ply.gmIntIsReady = true
|
||||||
|
|
||||||
|
if (!gmInte.config.forcePlayerLink) then return end
|
||||||
gmInte.verifyPlayer(ply)
|
gmInte.verifyPlayer(ply)
|
||||||
end)
|
end)
|
|
@ -8,6 +8,10 @@ function ply:gmIntGetConnectTime()
|
||||||
return self.gmIntTimeConnect || 0
|
return self.gmIntTimeConnect || 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ply:gmIntIsVerified()
|
||||||
|
return self.gmIntVerified || false
|
||||||
|
end
|
||||||
|
|
||||||
function ply:gmIntSetCustomValue(key, value)
|
function ply:gmIntSetCustomValue(key, value)
|
||||||
self.gmIntCustomValues = self.gmIntCustomValues || {}
|
self.gmIntCustomValues = self.gmIntCustomValues || {}
|
||||||
self.gmIntCustomValues[key] = value
|
self.gmIntCustomValues[key] = value
|
||||||
|
|
Loading…
Reference in New Issue
Block a user