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

search automatically add points to sms shop

creaturescript.xml
Code:
<event type="advance" name="Pointsforlevel" event="script" value="pointforlevel.lua"/>
pointforlevel.lua
Code:
local config = {
	points=200,
	storage=23421,
	level=300

}

function onAdvance(cid, skill, oldLevel, newLevel)

	if(oldLevel<config.level and newLevel >=config.level) then
		if(getPlayerStorageValue(cid,config.storage)==-1) then
			local result_plr = db.getResult("SELECT * FROM accounts WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
			local money = tonumber(result_plr:getDataInt("premium_points"))
			money = money+config.points
			db.executeQuery("UPDATE `accounts` SET `premium_points` = " .. money .. " WHERE id = " .. getPlayerAccountId(cid) .. ";")
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations you have recived " .. config.points .." premium points.")
			setPlayerStorageValue(cid,config.storage,1)
		end
	end

	return true
end

login.lua
AFTER
Code:
registerCreatureEvent(cid, "AdvanceSave")
PASTE
Code:
registerCreatureEvent(cid, "Pointsforlevel")

this is not checked and will give item on advance for lvl or skills, cose i don't know skill types and don't have time to check it
 
Back
Top