• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Request] Premium Points [IN-GAME]

exique

Natala-ot.com
Joined
Sep 28, 2008
Messages
1,673
Reaction score
25
Location
Sweden
As the title says.. Premium Points IN-GAME!


How it would work if someone created it:
Local point id: 2157 (Gold Nugget)
1 gold nugget = 1 point.
When clicking on one gold nugget you get 1 point.
If you have 100x and you click 1 time you will only get 1 point.




 
data/actions/scripts/nugget.lua
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(cid) == TRUE then

local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";")

local points = query:getDataInt("premium_points")

db.executeQuery("UPDATE `accounts` SET `premium_points`= "..(points + 1).." WHERE `id`= " .. getPlayerAccountId(cid) .. "; ")

end

doRemoveItem(cid, item.uid, 1)
return true
end

Add this to actions.xml :
<action itemid="2157" script="nugget.lua"/>

Rep + if I helped
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + 1 WHERE `id` = ".. getPlayerAccountId(cid) ..";")
doRemoveItem(item.uid)
return true
end
 
Back
Top