• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Premium account to free account

you could open the source files? then edit that on game.cpp

any error with the code that ninja gave?
Yes I did edit game.cpp and changed :
else if (player->isPromoted()) {
player->setVocation(player->vocation->getFromVocation());
}

to:

/*else if (player->isPromoted()) {
player->setVocation(player->vocation->getFromVocation());
}*/

I am assuming that part worked. The part that didn't work is what he said to change in my login.lua file. I changed it to
function onLogin(cid)
local player = Player(cid)

local loginStr = "Welcome to " .. configManager.getString(configKeys.SERVER_NAME) .. "!"
if player:getLastLoginSaved() <= 0 then
loginStr = loginStr .. " Please choose your outfit."
player:sendOutfitWindow()
else
if loginStr ~= "" then
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
end

loginStr = string.format("Your last visit was on %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved()))
end
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

if player:getPremiumDays() > 0 and player:getStorageValue(storageKey, 0) ~= 1 then
player:setStorageValue(storageKey, 1)
elseif player:getPremiumDays() == 0 and player:getStorageValue(storageKey, 1) == 1 then
player:setStorageValue(storageKey, 0)
player:setTown(Town(2)) -- Thais
player:teleportTo(player:getTown():getTemplePosition())
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end

player:registerEvent("PlayerDeath")
return true
end
But when I set the account's premium to 0 in my database and log in on the characer, he is still where I left him when I logged out, in darashia.
 
Okay, I tested both things I changed and not one works. When I log into the character after he becomes free account, he is still in darashia, not in the Thais temple. I even died on the character to see if the temple respawn change worked and he spawns in the darashia temple still. He also still loses his promotion.
 
Back
Top