Stanos
Veteran OT User
Hi
does anyone know how to send message in default chat when potion is used? I'm pretty much confused non of these works
tried: Player(cid):sendCancelMessage("message")
Player(cid):sendTextMessage(MESSAGE_STATUS_DEFAULT, "message")
does anyone know how to send message in default chat when potion is used? I'm pretty much confused non of these works
tried: Player(cid):sendCancelMessage("message")
Player(cid):sendTextMessage(MESSAGE_STATUS_DEFAULT, "message")
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
ITEM = 12779
local storage = 50000
local wait = 1.5
local pos1 = {x = getPlayerPosition(cid).x + 0, y = getPlayerPosition(cid).y + 0, z = getPlayerPosition(cid).z}
if fromPosition.x ~= CONTAINER_POSITION and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = 20000
REG_MANA = 20000
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
Player(cid):sendCancelMessage("message")
doSendMagicEffect(pos1, 98)
doRemoveItem(item.uid, 1)
exhaustion.set(cid, storage, wait)
elseif item.itemid == ITEM and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = 20000
REG_MANA = 20000
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
Player(cid):sendCancelMessage("message")
doSendMagicEffect(pos1, 98)
doRemoveItem(item.uid,1)
exhaustion.set(cid, storage, wait)
else
doPlayerSendCancel(cid, "You are exhausted.")
end
return TRUE
end