• 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!

Bug of Premium Lose

Dogrinha

New Member
Joined
Oct 6, 2019
Messages
206
Solutions
1
Reaction score
2
I just discovered a very dangerous bug to my server, I have a character in rook guard, and being free account, he is teleported to Thais, I would like to know how I configure to be born in his homeland, but for example, players who born in premium area not born in premium area, and if the player is rook, he is born in rook.

I need rook guard players born in rook guard, others can be born in thais
Tfs 0.4

LUA:
function onLogin(cid)

registerCreatureEvent(cid,"FimPremium")

local pos = {x = 32369, y = 32241, z = 7}

if isPremium(cid) then

setPlayerStorageValue(cid, 59898989, 1)

elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerSex(cid) == 0 then

doCreatureChangeOutfit(cid, {lookType = 136})
doTeleportThing(cid, pos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t)
t = "Your premium account is over"
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 59898989, -1)

elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerSex(cid) == 1 then
doCreatureChangeOutfit(cid, {lookType = 128})
doTeleportThing(cid, pos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t)
t = "Your premium account is over"
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 59898989, -1)
end

return TRUE

end


WhatsApp Image 2019-10-08 at 23.06.55.jpeg
 
Solution
Try this

LUA:
function onLogin(cid)

registerCreatureEvent(cid,"FimPremium")

local pos = {x = 32369, y = 32241, z = 7}
local rookpos ={x =, y =, z =} --- rook pos

if isPremium(cid) then

setPlayerStorageValue(cid, 59898989, 1)

elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerSex(cid) == 0 then
if(getPlayerVocation(cid) > 0) then
doCreatureChangeOutfit(cid, {lookType = 136})
doTeleportThing(cid, pos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t)
t = "Your premium account is over"
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 59898989, -1)
else
doCreatureChangeOutfit(cid, {lookType = 136})
doTeleportThing(cid, rookpos)
doPlayerSendTextMessage(cid...
Try this

LUA:
function onLogin(cid)

registerCreatureEvent(cid,"FimPremium")

local pos = {x = 32369, y = 32241, z = 7}
local rookpos ={x =, y =, z =} --- rook pos

if isPremium(cid) then

setPlayerStorageValue(cid, 59898989, 1)

elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerSex(cid) == 0 then
if(getPlayerVocation(cid) > 0) then
doCreatureChangeOutfit(cid, {lookType = 136})
doTeleportThing(cid, pos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t)
t = "Your premium account is over"
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 59898989, -1)
else
doCreatureChangeOutfit(cid, {lookType = 136})
doTeleportThing(cid, rookpos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t)
t = "Your premium account is over"
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 59898989, -1)
end
elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerSex(cid) == 1 then
if(getPlayerVocation(cid) > 0) then
doCreatureChangeOutfit(cid, {lookType = 128})
doTeleportThing(cid, pos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t)
t = "Your premium account is over"
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 59898989, -1)
else
doCreatureChangeOutfit(cid, {lookType = 128})
doTeleportThing(cid, rookpos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t)
t = "Your premium account is over"
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 59898989, -1)
end
end

return TRUE

end
 
Last edited:
Solution
LUA:
function onLogin(cid)

    registerCreatureEvent(cid, "FimPremium")
    
    local storage = 59898989
    if isPremium(cid) then
        if getPlayerStorageValue(cid, storage) ~= 1 then
            setPlayerStorageValue(cid, storage, 1)
        end
    else
        if getPlayerStorageValue(cid, storage) == 1 then
            if getPlayerVocation(cid) == 0 then
                doPlayerSetTown(cid, ROOK_TOWN_ID)
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
            end
            doCreatureChangeOutfit(cid, {lookType = getPlayerSex(cid) == 0 and 136 or 128})
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your premium account is over")
            setPlayerStorageValue(cid, storage, -1)   
        end
    end
    return true
end

Change ROOK_TOWN_ID to your Rookgaards town id
 
Back
Top