Crixpx
New Member
- Joined
- Jan 11, 2015
- Messages
- 70
- Reaction score
- 3
Hello I have edited this script so that every one of the characters connect you to a load every 1 hour with a limit of 5 loads "5 hours" to complete the 5 hours of as a reward 25 coins and the time will be saved even when disconnected so that Continue running the time when you connect and also how many loads you have
but i have a problem in console when i login
my ot is tfs 1.3
this is the script
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/onlinebonus.luanLogin
luaAddEvent(). Argument #3 is unsafe
stack traceback:
[C]: in function 'addEvent'
data/creaturescripts/scripts/onlinebonus.lua:28: in function <data/creaturescripts/scripts/onlinebonus.lua:17>
but i have a problem in console when i login
my ot is tfs 1.3
this is the script
Lua:
function addOnlineBonus(cid, horas, bonus_contador, bonus_max)
if not isPlayer(cid) then
return false
end
setPlayerStorageValue(cid, bonus_contador, getPlayerStorageValue(cid, bonus_contador) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Has stayed connected for 1 hour, And you have won a [tibia coin charge] = 5 tibia coins: ".. getPlayerStorageValue(cid,bonus_contador) .. ".")
if getPlayerStorageValue(cid, bonus_contador) >= bonus_max then
doPlayerSendTextMessage(cid, 19, "Seus ".. bonus_max .." tibia coin charge now are 25 Tibia coins!")
doPlayerAddTibiaCoins(cid, 25)
setPlayerStorageValue(cid, bonus_contador, 0)
end
addEvent(addOnlineBonus, horas * 3600 * 1000, cid, horas, bonus_contador, bonus_max)
end
function onLogin(cid)
local bonus_contador = 72702 -- Storage que vai guardar quantos online bonus o char possui.
local horas = 1 -- Quantidade de horas o char precisa ficar logado pra receber cada online bonus.
local bonus_max = 5 -- Quantidade de bonus que o char precisa atingir para ganhar 1 dia de premium account, zerando o contador.
if getPlayerStorageValue(cid, bonus_contador) > 0 then
doPlayerSendTextMessage(cid,22,"you have: " .. getPlayerStorageValue(cid,bonus_contador) .. "tibia coin charge.")
else
setPlayerStorageValue(cid, bonus_contador, 0)
doPlayerSendTextMessage(cid,22,"you have: 0 tibia coin charge.")
end
addEvent(addOnlineBonus, horas * 3600 * 1000, cid, horas, bonus_contador, bonus_max)
return true
end
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/onlinebonus.luanLogin
luaAddEvent(). Argument #3 is unsafe
stack traceback:
[C]: in function 'addEvent'
data/creaturescripts/scripts/onlinebonus.lua:28: in function <data/creaturescripts/scripts/onlinebonus.lua:17>
Last edited by a moderator: