function onSay(cid, words, param)
local k = getThingPos(cid)
doSendMagicEffect({x = k.x -1, y = k.y -1, z = k.z}, 30)
return true
end
pos = getCreaturePosition(cid)
doSendMagicEffect({x=pos.x, y=pos.y, z=pos.z}, CONST_ME_TELEPORT)
exhaustion =
{
check = function (cid, storage)
return getPlayerStorageValue(cid, storage) >= os.time()
end,
get = function (cid, storage)
local exhaust = getPlayerStorageValue(cid, storage)
if(exhaust > 0) then
local left = exhaust - os.time()
if(left >= 0) then
return left
end
end
return false
end,
set = function (cid, storage, time)
setPlayerStorageValue(cid, storage, os.time() + time)
end,
make = function (cid, storage, time)
local exhaust = exhaustion.get(cid, storage)
if(not exhaust) then
exhaustion.set(cid, storage, time)
return true
end
return false
end
}
function onSay(cid, words, param, channel)
if exhaustion.get(cid, 101) then
doPlayerSendCancel(cid, 'You are exhausted.')
return true
end
local position = getCreaturePosition(cid)
doSendMagicEffect({x = position.x, y = position.y - 1, z = position.z},CONST_ME_STEPSVERTICAL)
exhaustion.set(cid, 101, 5) -- 5 seconds
return true
end
@zbizu
Works perfectly, thanks man!
@Shadowsong
It wouldn't work if there was a player standing in the place of emoticon. Player's sprite would be on top.
Ok, it works fine for me too. Do your emoticons "follow" the player if he moves or just stand in place like ordinary magic effects?