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

Solved House teleport [ zombie arena ]

Sweetlove

Member
Joined
Jun 22, 2009
Messages
270
Reaction score
14
Location
Sverige
Hey, my house teleport scroll works in zombie arena and i really have no idea how to re-script that ...
All help is appreciated :P
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    return
    hasCondition(cid, CONDITION_INFIGHT) and
        doPlayerSendCancel(cid, "Sorry, you are in a fight.")
    or getPlayerLevel(cid) < getConfigInfo("levelToBuyHouse") and
        doPlayerSendCancel(cid, "Sorry, not possible.")
    or not getHouseByPlayerGUID(getPlayerGUID(cid)) and
        doPlayerSendCancel(cid, "Sorry, but you do not own a house.")
    or doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if hasCondition(cid, CONDITION_INFIGHT) then
        doPlayerSendCancel(cid, "Sorry, you are in a fight.")
    elseif getPlayerLevel(cid) < getConfigInfo("levelToBuyHouse") then
        doPlayerSendCancel(cid, "Sorry, not possible.")
    elseif not getHouseByPlayerGUID(getPlayerGUID(cid)) then
        doPlayerSendCancel(cid, "Sorry, but you do not own a house.")
    else
        doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
    end
    return true
end
 
#6. Give as much useful information as possible, this may help other people for solving your problem!
:(

Code:
local fromPos, toPos = {x = 1000, y = 1000, z = 7}, {x = 1000, y = 1000, z = 7}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if hasCondition(cid, CONDITION_INFIGHT) then
        doPlayerSendCancel(cid, "Sorry, you are in a fight.")
    elseif getPlayerLevel(cid) < getConfigInfo("levelToBuyHouse") then
        doPlayerSendCancel(cid, "Sorry, not possible.")
    elseif not getHouseByPlayerGUID(getPlayerGUID(cid)) then
        doPlayerSendCancel(cid, "Sorry, but you do not own a house.")
    elseif isInRange(getCreaturePosition(cid), fromPos, toPos) then
        doPlayerSendCancel(cid, "Sorry, you can't use this while you're in the zombie event.")
    else
        doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
    end
    return true
end
 
You could simply use a storage value for events, when a player is added to an event give them the storage, when they die or event ends remove.
 
Back
Top