OTcreator
Well-Known Member
- Joined
- Feb 14, 2022
- Messages
- 482
- Solutions
- 1
- Reaction score
- 53
Hi,
Is there any other way that will put less load on the server to change the player's storage when he loses connection (when he has IP=0) ?
I created such a script in globalevents, but it has to be called then every second.
(The idea is to protect against xlog, because if I want to add this to the onLogin function, the player who gives xlog is still logged in, so the storage will not change).
Is there any other way that will put less load on the server to change the player's storage when he loses connection (when he has IP=0) ?
I created such a script in globalevents, but it has to be called then every second.
(The idea is to protect against xlog, because if I want to add this to the onLogin function, the player who gives xlog is still logged in, so the storage will not change).
LUA:
for _, cid in ipairs(getPlayersOnline()) do
local playerIP = getPlayerIP(cid)
if (playerIP == "0.0.0.0") then
if (getPlayerStorageValue(cid, 45971) == 1) then
setPlayerStorageValue(cid, 45971, -1)
end
end
end
Last edited: