2023-12-28 10:11:05 -08:00
|
|
|
function CheckNamelock(player)
|
|
|
|
|
local namelockReason = player:kv():get("namelock")
|
|
|
|
|
if not namelockReason then
|
|
|
|
|
return true
|
|
|
|
|
end
|
2024-02-20 13:47:16 -03:00
|
|
|
|
2023-12-28 10:11:05 -08:00
|
|
|
player:setMoveLocked(true)
|
|
|
|
|
player:teleportTo(player:getTown():getTemplePosition())
|
2024-03-01 08:48:01 -03:00
|
|
|
player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Your name has been locked for the following reason: " .. namelockReason .. ".")
|
2023-12-28 10:11:05 -08:00
|
|
|
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()
|