• 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!

Change item for donation/premium points on website

vTune

KakelmästareN^
Joined
Jun 14, 2012
Messages
3,675
Reaction score
395
Location
Sweden
Hello there OTlanders!,

I wanna request a script for TFSV 0.3.6

So this how I want the script to work:

You pull a lever and it will remove item 6119 from your inventory and convert them to donation/premium points on the website.

And since I'm not a good scripter I have no start on this script and nor do I know if its hard to make.

I will rep++ the one who can help me and if you need anymore information just comment below/PM me.

Thanks in advance!

Kind Regards vTune
 
Go to data/lib/050 - functions.lua and add the following:
Lua:
function doPlayerAddPremiumPoints(cid, points)
    return db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end

That's a function made by Gcr...

And now, this is the action script:
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
while doPlayerRemoveItem(cid, 6119, 1) do
doPlayerAddPremiumPoints(cid, 1)
end
return true
end

You can edit this lines:
while doPlayerRemoveItem(cid, 6119, 1) do <--- 6119 = itemid; 1 = quantity to be removed to add premium points
doPlayerAddPremiumPoints(cid, 1) <--- 1 = premium points to be added

Hope it works.
 

Similar threads

Back
Top