ex eclipse
New Member
Code:
<mod name="Lottery System" version="1.5" author="vDk" contact="[email protected]" enabled="yes">
<config name="lottery_config"><![CDATA[
config = {
points = {1},
website = true
}
]]></config>
<globalevent name="lottery" interval="14400000" event="script"><![CDATA[
domodlib('lottery_config')
function onThink(interval)
local t = getPlayersOnline()
if #t == 0 then
return true
end
local winner = t[math.random(#t)]
local n = type(config.points) == 'number' and config.points or config.points[math.random(#config.points)]
db.executeQuery("UPDATE accounts SET premium_points = ".. n .." WHERE id = " .. getPlayerAccountId(winner))
doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. n .. " Premium Points! Congratulations! (Next Lottery in 4 hours)")
if config.website then
db.executeQuery("INSERT INTO `lottery` (`name`, `item`) VALUES (".. db.escapeString(getCreatureName(winner)) ..", '".. n .." Premium Points')")
end
return true
end
]]></globalevent>
</mod>
hi all im using this mod to raffle 1 premium points each 4 hours to a random player
the problem is that if player already got 10 points for example in ur account when the mod gives +1 point he stay with 1 point and lose the 10points that had before lol
also if u win 1 point and win again u keep with 1 point
the script should be set premium points +1 and not ="1"
someone knows how to fix it ?
Last edited by a moderator: