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

Premium points on Use

Solution
Code:
local function doPlayerAddPremiumPoints(cid, count)
   db.query('UPDATE accounts SET premium_points = premium_points+'.. count ..' WHERE id = ' .. getAccountNumberByPlayerName(getCreatureName(cid)))
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
   local player = Player(cid)
   doPlayerAddPremiumPoints(cid, 30)
   player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have recived 30 shop points to your account.")
   player:getPosition():sendMagicEffect(28)
   item:remove(1)
   return true
end
Code:
local function doPlayerAddPremiumPoints(cid, count)
   db.query('UPDATE accounts SET premium_points = premium_points+'.. count ..' WHERE id = ' .. getAccountNumberByPlayerName(getCreatureName(cid)))
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
   local player = Player(cid)
   doPlayerAddPremiumPoints(cid, 30)
   player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have recived 30 shop points to your account.")
   player:getPosition():sendMagicEffect(28)
   item:remove(1)
   return true
end
 
Solution
Code:
local function doPlayerAddPremiumPoints(cid, count)
   db.query('UPDATE accounts SET premium_points = premium_points+'.. count ..' WHERE id = ' .. getAccountNumberByPlayerName(getCreatureName(cid)))
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
   local player = Player(cid)
   doPlayerAddPremiumPoints(cid, 30)
   player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have recived 30 shop points to your account.")
   player:getPosition():sendMagicEffect(28)
   item:remove(1)
   return true
end
worked ty!
 
Back
Top