• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Delete Please

Nice script, but try to make 'items' config in LUA table.


One fix:
PHP:
function doRemovePremiumPoints(accountName, points)
	points = tostring(points)
	return db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` -' .. points .. ' WHERE `name` = ' .. accountName .. ' LIMIT 1;')
end
function CurrentPoints(accountName)
	playerpoints = db.getResult('SELECT `premium_points` FROM `accounts` WHERE `name` = ' .. accountName .. ' LIMIT 1;')
	return playerpoints:getDataInt("premium_points")
end
Should be:
PHP:
function doRemovePremiumPoints(accountName, points)
	points = tostring(points)
	return db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` -' .. points .. ' WHERE `name` = ' .. db.escapeString(accountName) .. ' LIMIT 1;')
end
function CurrentPoints(accountName)
	playerpoints = db.getResult('SELECT `premium_points` FROM `accounts` WHERE `name` = ' .. db.escapeString(accountName) .. ' LIMIT 1;')
	return playerpoints:getDataInt("premium_points")
end
When you send any string to database from LUA always use:
db.escapeString(str)
1. Secure.
2. Sometimes error can occur.
 
Yes!! Congratulations!!

Help the stupid people that download and run servers grow and make money!!

You should be proud of yourself..

Ugly scripting anyways..
 
well, i ddint knew it was so bad .... its my fucking first script :S

@PhoOwned
2. Sometimes error can occur. ????
Well i never do get an error
 
Last edited:
well, i ddint knew it was so bad .... its my fucking first script :S

@PhoOwned
2. Sometimes error can occur. ????
Well i never do get an error
It'd occur that error only when it's removing points from account that contains a letter/string as you're not using " "
Example:

Your:
Code:
function doRemovePremiumPoints(accountName, points)
    points = tostring(points)
    return db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` -' .. points .. ' WHERE `name` = [B]' .. db.escapeString(accountName) .. '[/B] LIMIT 1;')
end
Should be:
Code:
function doRemovePremiumPoints(accountName, points)
    points = tostring(points)
    return db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` -' .. points .. ' WHERE `name` = [B]"' .. db.escapeString(accountName) .. '"[/B] LIMIT 1;')
end
 
Back
Top