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

Lua Show the time remaining of "Addevent" function?

tosse12

Panchira Project Member
Joined
Jun 10, 2007
Messages
864
Reaction score
9
Location
Sweden
Greetings OtLanders

I am wondering if it's possible to show the "addEvent" remaining time to the player.
Like, everytime you are using a door with "20302" in uniq id, and have storagevalue == 1
then display a message (like: You have already entered this quest. You have XX minutes remaining to re-enter this door".

(an example script)
LUA:
function onUse(cid, item, frompos, item2, topos)
		function doQuest()
			setPlayerStorageValue(cid, 1027, -1)
		end
local itemid = 6261
    if item.uid == 1027 or 1028 then
        if getPlayerStorageValue(cid,1027) == 1 then
            doTransformItem(item.uid,itemid)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Sorry, but you have started the Black Knight Quest and may not return!')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have started the Black Knight Quest and may not return!.')
			doTransformItem(item.uid,itemid+1)
			setPlayerStorageValue(cid, 1027, 1)
			addEvent(doQuest, 600000)
        end
    end
    return 1
end
(The script do work, but as I said, I want the show the remaining time part)

If this is possible, HOW? :)
If not, just say "no" <_<
 
Back
Top