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

Use an Item and add to the account 1 premium point

chiro

New Member
Joined
Dec 3, 2010
Messages
13
Reaction score
0
Hello guys of ot land
I need the next script

A Player Use an item with id 9020 and when use this item add to the player`s account a one premium point to use on shop offer of the web.

Please :)
 
use this as action

addpoints.lua
Lua:
local points = 1 -- amount of premium points

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isPlayer(cid) == TRUE  then
 local Sql = "UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." where id="..getPlayerAccountId(cid)
                 db.executeQuery(Sql)
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You Have Received 1 Premium Point")
	doRemoveItem(item.uid)
	end
        return true
end

and this in action.xml
XML:
<action itemid="9020 " event="script" value="addpoints.lua"/>
 
Back
Top