zerghel
Tsuni
- Joined
- Jul 1, 2008
- Messages
- 299
- Reaction score
- 9
Hi.
i got this script to give 1 coin every hour online (creaturescript)
but it need an "account, ip check" or something cause i allow multiclienting from same account
for 3 characters they get 3 coins every hour to their account
hope u can helpme with this
thx in advance
i got this script to give 1 coin every hour online (creaturescript)
but it need an "account, ip check" or something cause i allow multiclienting from same account
for 3 characters they get 3 coins every hour to their account
hope u can helpme with this
thx in advance
Lua:
local event = {}
local timeOnline = 60 * 60 * 1000
function addPremiumPoint(cid)
local player = Player(cid)
if player then
db.query("UPDATE accounts SET coins = coins + 1 WHERE id = '" ..player:getAccountId().. "';")
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "You have been online for an hour and have earned 1 Store coin.")
event[cid] = addEvent(addPremiumPoint, timeOnline, cid)
return
end
event[cid] = nil
end
function onLogin(player)
local cid = player:getId()
if not event[cid] then
event[cid] = addEvent(addPremiumPoint, timeOnline, cid)
end
return true
end