Hello!
How I do to add one line that will send a message to the player on deafult at the moment that he use the lever?
Script -> pastebin.com/XsXNp3E9
local c = {
pos = {x = 220, y = 1479, z = 8},
itemid = 1304,
time = 900,
msg = "You have clicked the switch"
}
local function Remove(c)
doCreateItem(c.itemid, 1, c.pos)
doTransformItem(getTileItemById(c.fromPosition, 1946).uid, 1945)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
c.fromPosition = fromPosition
if item.itemid == 1945 then
doRemoveItem(getTileItemById(c.pos, c.itemid).uid)
addEvent(Remove, c.time * 1000, c)
doTransformItem(item.uid, 1946)
elseif item.itemid == 1946 then
if getTileItemById(c.pos, c.itemid).uid > 0 then
doTransformItem(item.uid, 1945)
else
doPlayerSendCancel(cid, "It seems the lever has been already used.")
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, c.msg)
return true
end
His code does not reflect 1.1+ it is still using cid to refer to the player's user data, so i implemented the proper function, what you wrote is normally seen for 1.1+, where player is used directly.Use that ish ^ if you fancy tho! lol
Learn the language, atleast the basicsSo thanks everyone for answer my post. I have used it and now I need other thing.
How can I make it for show how many seconds left to the lever back to normal position? A message appear at the moment that the player use the lever, an animate text above the lever show the exatcly second.
Like:
60..
59..
58..
57..
How I do to make it? xD