mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-26 06:01:31 +00:00
Fixed undefined player issue at connection
This commit is contained in:
parent
0001bc7a12
commit
7620862fc1
1 changed files with 8 additions and 4 deletions
|
@ -73,13 +73,17 @@ function admin.onconnect(clientId, firstTime, isBot)
|
||||||
stats.set(clientId, "namechangePts", 0) ]]
|
stats.set(clientId, "namechangePts", 0) ]]
|
||||||
|
|
||||||
local guid = et.Info_ValueForKey(et.trap_GetUserinfo(clientId), "cl_guid")
|
local guid = et.Info_ValueForKey(et.trap_GetUserinfo(clientId), "cl_guid")
|
||||||
local playerId = db.getplayer(guid)["id"]
|
local player = db.getplayer(guid)
|
||||||
|
|
||||||
|
if player then
|
||||||
|
local playerId = player["id"]
|
||||||
local mute = db.getMuteByPlayer(playerId)
|
local mute = db.getMuteByPlayer(playerId)
|
||||||
|
|
||||||
if mute then
|
if mute then
|
||||||
players.setMuted(clientId, true, mute["type"], mute["issued"], mute["expires"])
|
players.setMuted(clientId, true, mute["type"], mute["issued"], mute["expires"])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
events.handle("onClientConnect", admin.onconnect)
|
events.handle("onClientConnect", admin.onconnect)
|
||||||
|
|
||||||
function players.oninfochange(clientId)
|
function players.oninfochange(clientId)
|
||||||
|
|
Loading…
Reference in a new issue