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

A simple help

darcioantonio

www.adventurerpg.com.br
Joined
Jul 30, 2013
Messages
165
Solutions
1
Reaction score
4
Location
Brasil
Twitch
darcio_
YouTube
UCEXCOEw_dYchojHNz
Good afternoon I have this script here.

Lua:
local min = 1  -- aqui é o tempo em minutos ja esta configurado pra vc

ev = min*1000*60
pos = {x=964 , y=920 , z=7 } -- posição do templo
pos1 = {x=961 , y=916, z=7} -- posição de onde o tp vai levar o player, posicao da arena

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
name = getPlayerName(cid)
local test = min*60
time = os.time() + test

if getPlayerStorageValue(cid, 66116) - os.time() > 0 then
doTeleportThing(cid, fromPosition)
doPlayerSendTextMessage(cid, 22, ""..name.." voce saiu do evento antes do seu tempo portanto nao podera entrar ate que acabe")
else
setPlayerStorageValue(cid, 66116, time)
doPlayerSendTextMessage(cid, 22, ""..name.." se voce relogar sera transferido ao cp automaticamente")
doTeleportThing(cid, pos1)
addEvent(t, ev, cid, pos)
end
return true
end
     
function t(cid, pos)
doTeleportThing(cid, pos)
setPlayerStorageValue(cid, 9898, -1)
return true
end

This script ai causes the char when it passes through the portal of treiner, stay in it for 1 minute there when the 1 minute is kikado out ... the script is of the geito that precizo ....

Well I need a script that when I want to leave the trein in type 10 seconds cancel this script from above because if I put a portal to leave the treiner he will throw me out normal but when I give the time of 1 minute of the Script above he teleports me back to the temple.
 
Solution
Not sure what you want exactly. Do you want to stop the event if player leaves earlier than 60 seconds?

Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

    local v = os.time + 60
    local pos = {
        {x=964,y=920,z=7},
        {x=961,y=916,z=7},
    }
  
    if not isPlayer(cid) then
        return true
    end
  
    local function Exit(t)
        if isPlayer(t.pid) then
            doTeleportThing(t.pid, pos[1])
            setPlayerStorageValue(t.pid, 9898, -1)
            setPlayerStorageValue(t.pid, 9999, -1)
        end
        return isPlayer(t.pid)
    end
  
    if getPlayerStorageValue(cid, 66116) - os.time() > 0 then
        doTeleportThing(cid, fromPosition)...
Not sure what you want exactly. Do you want to stop the event if player leaves earlier than 60 seconds?

Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

    local v = os.time + 60
    local pos = {
        {x=964,y=920,z=7},
        {x=961,y=916,z=7},
    }
  
    if not isPlayer(cid) then
        return true
    end
  
    local function Exit(t)
        if isPlayer(t.pid) then
            doTeleportThing(t.pid, pos[1])
            setPlayerStorageValue(t.pid, 9898, -1)
            setPlayerStorageValue(t.pid, 9999, -1)
        end
        return isPlayer(t.pid)
    end
  
    if getPlayerStorageValue(cid, 66116) - os.time() > 0 then
        doTeleportThing(cid, fromPosition)
        doPlayerSendTextMessage(cid, 22, getPlayerName(cid) .. " voce saiu do evento antes do seu tempo portanto nao podera entrar ate que acabe")
    else
        setPlayerStorageValue(cid, 66116, v)
        doPlayerSendTextMessage(cid, 22, getPlayerName(cid) .." se voce relogar sera transferido ao cp automaticamente")
        doTeleportThing(cid, pos[2])
        setPlayerStorageValue(cid, 9999, addEvent(Exit, 60*1000, {pid = cid})
    end
  
    return true
end

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)

    if not isPlayer(cid) then
        return true
    end

    if getPlayerStorageValue(cid, 9999) > 0 then
        stopEvent(getPlayerStorageValue(cid, 9999))
    end
  
    return true
end
 
Last edited:
Solution

Similar threads

Replies
0
Views
379
Back
Top