mirror of
https://github.com/opentibiabr/canary
synced 2026-08-16 06:26:09 -04:00
22 lines
716 B
Lua
22 lines
716 B
Lua
function CheckNamelock(player)
|
|
local namelockReason = player:kv():get("namelock")
|
|
if not namelockReason then
|
|
return true
|
|
end
|
|
|
|
player:setMoveLocked(true)
|
|
player:teleportTo(player:getTown():getTemplePosition())
|
|
player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Your name has been locked for the following reason: " .. namelockReason .. ".")
|
|
player:openStore("extras")
|
|
addPlayerEvent(sendRequestPurchaseData, 50, player, 65002, GameStore.ClientOfferTypes.CLIENT_STORE_OFFER_NAMECHANGE)
|
|
addPlayerEvent(CheckNamelock, 30000, player)
|
|
end
|
|
|
|
local playerLogin = CreatureEvent("NamelockLogin")
|
|
|
|
function playerLogin.onLogin(player)
|
|
addPlayerEvent(CheckNamelock, 1000, player)
|
|
return true
|
|
end
|
|
|
|
playerLogin:register()
|