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

HOUSE LOSS (onlogin)

haslo1

New Member
Joined
Jun 16, 2010
Messages
48
Reaction score
0
i need script if i have house and premium and if i loss premium house clean and no owner
 
XML:
<event type="login" name="houseless" event="script" value="houseless.lua"/>
Lua:
function onLogin(cid)
    local home = getHouseByPlayerGUID(getPlayerGUID(cid))
    if home > 0 and not isPremium(cid) then
        doCleanHouse(home)
        setHouseOwner(home, 0)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You\'ve lost your house because you are not premium anymore.')    
        if getHouseFromPos(getThingPos(cid)) == home then
            doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
        end
    end
    return true
end
 
Lua:
function onLogin(cid)
    local home = getHouseByPlayerGUID(getPlayerGUID(cid))
    if home ~= nil and not isPremium(cid) then
        setHouseOwner(home, 0, true)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You\'ve lost your house because you are not premium anymore.')
        if getHouseFromPos(getThingPos(cid)) == home then
            doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
        end
    end
    return true
end
 
Back
Top