local config = {
soundName = "sounds/Centralplains.wav",
tileId = 103,
storage = 55000,
musicTime = 118, --em segundos
musicTimeStorage = 91821
}
function onStepIn(cid, item, frompos, item2, topos)
if not isPlayer(cid) then return true end
if getPlayerStorageValue(cid, config.storage) < 1 then
if getPlayerStorageValue(cid, config.musicTimeStorage) > os.time() then
return setPlayerStorageValue(cid,config.storage,1)
else
doPlayerSendTextMessage(cid, 26, config.soundName)
setPlayerStorageValue(cid, config.storage, 1)
setPlayerStorageValue(cid, config.musicTimeStorage, os.time() + config.musicTime)
end
end
end
function onStepOut(cid, item, frompos, item2, topos)
if not isPlayer(cid) then return true end
if getPlayerStorageValue(cid, config.storage) == 1 and item2.itemId ~= config.tileId then
setPlayerStorageValue(cid, config.storage, -1)
end
end