canary/data/scripts/creaturescripts/logout.lua
Beats 35a175ebc2
[Improvement] - rework on exercise weapons system (#180)
Rework on exercise weapon with tibia global equal behavior

Added config key "maxAllowedOnADummy ", default is "1"
Created table for exercise functions and variables

Start training with someone already training on that dummy and the message will be sent that someone is already training.
If someone is training and connects to the game, that user appears as Exercise Dummy Training .
If someone is training, send request to add this player on vip list, that user appears as Exercise Dummy Training.
When are training and disconnect from the game, on reconnect, the training stopped.cise Dummy Training
When are training and disconnect from the game, on reconnect, the training stopped
2022-01-08 00:08:08 -03:00

17 lines
385 B
Lua

local logout = CreatureEvent("PlayerLogout")
function logout.onLogout(player)
local playerId = player:getId()
if nextUseStaminaTime[playerId] then
nextUseStaminaTime[playerId] = nil
end
if onExerciseTraining[playerId] then
stopEvent(onExerciseTraining[playerId].event)
onExerciseTraining[playerId] = nil
player:setTraining(false)
end
return true
end
logout:register()