• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Item give points

All depends on where you're storing the points, what the points are supposed to be, and if you have a function for the points.
 
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local points = 5 
    function doAddPoints(cid, points) 
  db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") 
    doRemoveItem(item.uid)
  end
     return true
end

try :/
 
If Knight God's script doesn't work, try this one:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local points = 5 
  db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") 
    doRemoveItem(item.uid)
     return true
end
Only removed 2 lines... xDDD Cause i think they dont have any function in the script....
 
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local points = 5 
    function doAddPoints(cid, points) 
      db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") 
        doRemoveItem(item.uid)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "you have received 5 premium points.")
  end
     return true
end
 
OR:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition) 
local points = 5
function doAddPremiumPoints(accountName, points)
	points = tostring(points)
	return db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` ' .. (not points:find('^%-') and '+' or '-') .. points:sub(points:find('%d+')) .. ' WHERE `name` = ' .. accountName .. ' LIMIT 1;')
end
-- By Erexo
doAddPremiumPoints(getPlayerAccount(cid), points)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "you have received "..points.." premium points.") 
return true
end

NOT TESTED
 
Last edited:
Back
Top