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

Avoid abusing supports in game

Calon

Experienced Member
Joined
Feb 6, 2009
Messages
1,070
Reaction score
21
Hello,

im trying to make a script or something to avoid the players abuse ingame against free supports such as free points

how people abuse it ?
for example i set a150 free points at level 150
so when the player get lvl 150 automatically receive a 150 points in (account)

so this player allow to be abuse this action by creating 5 characters in same account and keep getting points9 5*150 = 750 free point)s not only 150

so there is a way to avoid this by setting a global storage or something ?
 
use this lib part first , credits to teckman
PHP:
CREATE TABLE IF NOT EXISTS `accounts_storage` (
  `id` int(11) NOT NULL DEFAULT '0',
  `key` int(10) NOT NULL DEFAULT '0',
  `value` varchar(255) NOT NULL DEFAULT '0',

  UNIQUE KEY `id_key` (`id`,`key`),
  KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
LUA:
function setAcccountStorageValue(cid, key, value)

	local result = db.getResult("SELECT `key` FROM `accounts_storage` WHERE (`id` = '" .. getPlayerAccountId(cid) .. "' and `key` = '" .. key .. "');")
	if result:getDataInt("key") == nil then
		return db.executeQuery("INSERT INTO `accounts_storage` (`id`, `key`, `value`) VALUES (" .. getPlayerAccountId(cid) .. ", " .. key .. ", " .. value .. ")"), result:free()
	else
		return db.executeQuery("UPDATE `accounts_storage` SET `value` = " .. value .. " WHERE (`id` = '" .. getPlayerAccountId(cid) .. "' and `key` = '" .. key .. "');"), result:free()
	end
end

function getAccountStorageValue(cid, key)
	local value = db.getResult("SELECT `value` FROM `accounts_storage` WHERE (`id` = '" .. getPlayerAccountId(cid) .. "' and `key` = '" .. key .. "');")
	return value:getDataInt("value"), value:free()
end
then use this code in creaturescripts...
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)

	if newLevel >= 150 and getAccountStorageValue(cid, 234) == -1 then
		setAccountStorageValue(cid, 234, 1)
		db.executeQuery('UPDATE accounts SET premium_points=premium_points+150 WHERE id=' .. getPlayerAccountId(cid))
		doBroadastMessage(getCreatureName(cid) .. ' has reached level 150 and is therefore rewarded with 150 premium points!')
	end
	return true
end

Rep++ If It Helpful For You..
 
Last edited:
Back
Top