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

Problem Premium scroll script !

Sami_san

New Member
Joined
May 20, 2016
Messages
76
Reaction score
1
Hello i have this premium scroll script that on use gives premium points to the ots shop but when i run the server i get an error of db.executeQuery nill value

local points = 30 -- 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 10 Premium Point")
doRemoveItem(item.uid)
end
return true
end
 
on your script i cant use the item . i just press use and nothing happens . no message in the console and no points in the shop. I dont even get a message you cant use that object.
 
try
Code:
local addpoints = 10 -- amount of points to add

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if isPlayer(player) and doRemoveItem(item.uid, 1) then
db.query("UPDATE `accounts` SET `points` = `points` + "..addpoints.." WHERE `id` = '" ..getAccountNumberByPlayerName(player:getName()).. "';")
doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, ""..addpoints.." premium points have been added to your account.")
return true
else
return false
end
end
 
i just tried it, and the scripts executes fine on my 1.2 tfs server, however i get a query error (since i dont have a points field..)
 
Can i get sources link for my tfs 1.2 please? Please guys.
And using those sources wont override scripts i added to my ots will they?
 
Back
Top