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

TalkAction Buy Credits For VIP Days

Acubens

Old Penguin
Joined
May 6, 2008
Messages
1,279
Solutions
13
Reaction score
197
Location
Venezuela
Many new users in the world of open tibia, sometimes not have the facility to implement a system that provide support in the form of monetizing your server, So here I bring a simple script with which you can change your VIP days for credits on the server ...


Example: You want a weapon that is being sold in thewebsite of the server but you do not have a paypal or pay dao that can add points to your account? then come into play here! "change" making this
talkactions 5 DAYS VIP will be removed from your account and be added 10 points in your Premiums points.

What you need?

You need install all Kekox VIP System

and Save this in your Talkactions/scripts with name "change.lua"
LUA:
local t = {

	days = 5, 
	points = 10

}
 
function onSay(cid, words, param)
 
	if doRemoveVipDays(cid,t.days) then
		db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. t.points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
                doPlayerPopupFYI(cid, "Succesfull Change now you have now\n~~~~~~~~ " .. getPlayerVipDays(cid) .. " VIP Days left~~~~~~~")
		doSendMagicEffect(getPlayerPosition(cid), 10)	
	else     
		doPlayerPopupFYI(cid, "You dont have VIP days to change!")
 		doSendMagicEffect(getPlayerPosition(cid), 2)
	end 
return TRUE
end

and add this to your Talkactions.xml

LUA:
<talkaction words="!change;/change" event="script" value="change.lua"/>
 
Last edited:
lol, you have bug... if i have 1 point i can change and removes 5 days... : )

PHP:
function onSay(cid, words, param)
	local points = 5 -- how many points player gets for exchange
	local vipdays = 5 -- how many vip days player need to exchange
	return (doRemoveVipDays(cid,vipdays)) and (db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + 10 WHERE `id` = " .. getPlayerAccountId(cid) .. ";") and doPlayerPopupFYI(cid, "succesfull Change now you have\n~~~~~~ " .. getPlayerVipDays(cid) .. " days VIP~~~~~~~")) or doPlayerPopupFYI(cid, "You need "..vipdays.." vip days. ")
end
 
@Edit

Now dont work, premium_points = -5 in the database when i havent VIP Days
 
Last edited:
How i can set this?:
- Add one point at each login
- Add one point if the player is online 2 hours
 
Back
Top