Hi, I'm here to present you my Vip System, finished seconds ago.
I spent days looking for a Vip System good enough to provide me what I wanted, I decided to edit+make my own, for real, Complet system.
Well, the modifications are HUGE, I spent a lot of time, so be patient.
Features:
-Silver/Gold VIP system, in wich the possibilities are endless and provides versatility for players, since there's premmium account, silver vip and gold vip, what also help the server owner to sell and make some money, once that there are options.
-Silver/Gold VIP different experience rates [release]
-Buyable via web site, just like premmy account:
with trans history too:
Gold VIP
Silver VIP
-VIP per ACCOUNT
-Silver/Gold VIP door:
Player's Command
/vip -To check either Silver or Gold VIP days.
GM's Commands
/addsilvervip name,days -> Add Silver VIP days.
/addgoldvip name,days -> Add Gold VIP days.
Extra
-Once you became Gold VIP, you can't buy Silver VIP.
-Once you have became Silver VIP, you can't buy Gold VIP
nor can add vip days using game master:
Let's do it!
Step A: ...data/lib/050-function.lua
NOTE: you need LIST and STRING functions, so only if you DO NOT HAVE IT INSTALLED ALREADY, add
to 050-function.lua
Step A.b: open your OTs config.lua and add this:
Step B: ...data/creaturescripts/creaturescripts.xml
Step B.a: ...data/creaturescripts/scripts/VIP.LUA
Step C: ...data/talkactions/talkactions.xml
Step C.a: ...data/talkactions/scripts/VIP.LUA
Step C.b: ...data/talkactions/scripts/SILVERVIP.LUA
Step C.c: ...data/talkactions/scripts/GOLDVIP.LUA
Silver/Gold VIP door
Step A: ...data/actions/actions.xml
Step A: ...data/actions/scripts/SILVERVIPDOOR.LUA
Silver VIP door:
Step A: ...data/actions/scripts/GOLDVIPDOOR.LUA
Gold VIP door:
A GOLD VIP PLAYER IS ALLOWED TO PASS THROUGH SILVER VIP DOOR!
A GOLD VIP PLAYER IS ALLOWED TO PASS THROUGH SILVER VIP DOOR!
Since the website part is too enormous, I'm attaching the files here.
Download:
via Attachment: View attachment htdocs.rar
via 2shared: 2shared - download htdocs.rar
via 4shared: 4shared.com - online file sharing and storage - download htdocs.rar
SQL part
Add to you OTs database:
That should be it, please, report bugs, it worked fine hereeace: but maybe I forgot to post something here
Oncoming Update:
-Upgrade vip from silver to gold.
-Silver/Gold tiles.
-PM any ideas.
Known Bugs:
-On website, Gold VIP Points cost is shown = Silver VIP Points cost.
Fixing:
1.open htdocs/shopsystem.php;
2.go to the end of the line number 274 (ctrl+g);
3.search for "por '.$sVIP['points'].' points"
4.replace it for "por '.$gVIP['points'].' points"
Regards
Note: edited from Azi's VIP System (http://otland.net/f163/best-vip-system-functions-vip-account-30286/)
door edited from Shawak's [Release] VIP System (http://otland.net/f81/release-vip-system-44986/)
thx to 'em
I spent days looking for a Vip System good enough to provide me what I wanted, I decided to edit+make my own, for real, Complet system.
Well, the modifications are HUGE, I spent a lot of time, so be patient.
Features:
-Silver/Gold VIP system, in wich the possibilities are endless and provides versatility for players, since there's premmium account, silver vip and gold vip, what also help the server owner to sell and make some money, once that there are options.
-Silver/Gold VIP different experience rates [release]
-Buyable via web site, just like premmy account:
with trans history too:
Gold VIP
Silver VIP
-VIP per ACCOUNT
-Silver/Gold VIP door:
Player's Command
/vip -To check either Silver or Gold VIP days.
GM's Commands
/addsilvervip name,days -> Add Silver VIP days.
/addgoldvip name,days -> Add Gold VIP days.
Extra
-Once you became Gold VIP, you can't buy Silver VIP.
-Once you have became Silver VIP, you can't buy Gold VIP
nor can add vip days using game master:
Let's do it!
Step A: ...data/lib/050-function.lua
Code:
function getSilverVipTime(accountName)
local result = db.getResult("SELECT `silverviptime` FROM `accounts` WHERE `name` = '" .. accountName .. "' LIMIT 1;")
if(result:getID() ~= -1) then
if(result:getDataInt("silverviptime") > os.time())then
return result:getDataInt("silverviptime")-os.time()
else
return 0
end
else
return FALSE
end
result:free()
end
function isSilverVip(accountName)
if(getSilverVipTime(accountName) > 0 or getBooleanFromString(getConfigInfo('freeSilverVip')))then
return TRUE
else
return FALSE
end
end
function doAddSilverVipTime(accountName, silverVipTime)
local result = db.getResult("SELECT `silverviptime` FROM `accounts` WHERE `name` = '" .. accountName .. "' LIMIT 1;")
if(result:getID() ~= -1) then
if(result:getDataInt("silverviptime") > os.time())then
timeToAdd = result:getDataInt("silverviptime")+silverVipTime
else
timeToAdd = os.time()+silverVipTime
end
db.executeQuery("UPDATE `accounts` SET `silverviptime` = " .. timeToAdd .. " WHERE `name`='" .. accountName .. "' LIMIT 1;")
result:free()
return TRUE
end
end
function getGoldVipTime(accountName)
local result = db.getResult("SELECT `goldviptime` FROM `accounts` WHERE `name` = '" .. accountName .. "' LIMIT 1;")
if(result:getID() ~= -1) then
if(result:getDataInt("goldviptime") > os.time())then
return result:getDataInt("goldviptime")-os.time()
else
return 0
end
else
return FALSE
end
result:free()
end
function isGoldVip(accountName)
if(getGoldVipTime(accountName) > 0 or getBooleanFromString(getConfigInfo('freeGoldVip')))then
return TRUE
else
return FALSE
end
end
function doAddGoldVipTime(accountName, goldVipTime)
local result = db.getResult("SELECT `goldviptime` FROM `accounts` WHERE `name` = '" .. accountName .. "' LIMIT 1;")
if(result:getID() ~= -1) then
if(result:getDataInt("goldvip") > os.time())then
timeToAdd = result:getDataInt("goldviptime")+goldVipTime
else
timeToAdd = os.time()+goldVipTime
end
db.executeQuery("UPDATE `accounts` SET `goldviptime` = " .. timeToAdd .. " WHERE `name`='" .. accountName .. "' LIMIT 1;")
result:free()
return TRUE
end
end
Code:
function timeString(timeDiff)
local dateFormat = {
{"day", timeDiff / 60 / 60 / 24},
{"hour", timeDiff / 60 / 60 % 24},
{"minute", timeDiff / 60 % 60},
{"second", timeDiff % 60}
}
local out = {}
for k, t in ipairs(dateFormat) do
local v = math.floor(t[2])
if(v > 0) then
table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
end
end
return table.concat(out)
end
function list (keys, values)
local list = {}
for i=1, #values do
if keys[i] then
list[keys[i]] = values[i]
else
list[i] = values[i]
end
end
return list
end
Step A.b: open your OTs config.lua and add this:
Code:
freeSilverVip = "false" //Free Silver Vip false/true
freeGoldVip = "false" //Free Gold Vip false/true
Step B: ...data/creaturescripts/creaturescripts.xml
Code:
<event type="login" name="VipRate" event="script" value="vip.lua"/>
Step B.a: ...data/creaturescripts/scripts/VIP.LUA
Code:
function onLogin(cid)
accountName = getPlayerAccount(cid)
svip = isSilverVip(accountName)
gvip = isGoldVip(accountName)
if (svip == TRUE) then
doPlayerSetRate(cid, SKILL__LEVEL, 1.5)
elseif(gvip == TRUE) then
doPlayerSetRate(cid, SKILL__LEVEL, 2.5)
end
return TRUE
end
return TRUE
Step C: ...data/talkactions/talkactions.xml
Code:
<talkaction log="yes" words="/addsilvervip" access="5" event="script" value="silvervip.lua"/>
<talkaction log="yes" words="/addgoldvip" access="5" event="script" value="goldvip.lua"/>
<talkaction log="yes" words="/vip" access="0" event="script" value="vip.lua"/>
Step C.a: ...data/talkactions/scripts/VIP.LUA
Code:
function onSay(cid, words, param)
accountName = getPlayerAccount(cid)
time1 = getSilverVipTime(accountName)
time2 = getGoldVipTime(accountName)
if(words == "/vip")then
if(time1 > 0)then
doPlayerSendTextMessage(cid, 19, "Sua conta tem "..timeString(time1).." de Silver VIP.")
else
doPlayerSendTextMessage(cid, 19, "Voce nao tem dias de Silver VIP.")
end
if(time2 > 0)then
doPlayerSendTextMessage(cid, 19, "Sua conta tem "..timeString(time2).." de Gold VIP.")
else
doPlayerSendTextMessage(cid, 19, "Voce nao tem dias de Gold VIP.")
end
else
doPlayerSendTextMessage(cid, 19, "Sua conta tem Vip Gr\átis.")
end
return true
end
Step C.b: ...data/talkactions/scripts/SILVERVIP.LUA
Code:
function onSay(cid, words, param)
if(words == "/addsilvervip")then
if(param ~= "")then
local params = list({"name", "days"}, string.explode(param, ',', 2))
local player = getPlayerByName(params["name"])
if(isPlayer(player) == TRUE)then
if(isNumber(params["days"]))then
local days = (params["days"]*3600*24)
if(isGoldVip(getPlayerAccount(player)))then
time1 = getGoldVipTime(getPlayerAccount(player))
doPlayerSendTextMessage(cid, 19, "Esta conta j\á possui "..timeString(time1).." de Gold VIP, n\ão sendo assim poss\ível adicionar dias de Silver Vip.")
else
doAddSilverVipTime(getPlayerAccount(player), days)
end
else
doPlayerSendCancel(cid, "Quantidade de dias deve ser n\úmerica.")
end
else
doPlayerSendCancel(cid, "O Player n\ão est\á online.")
end
else
doPlayerSendCancel(cid, "Comando requer par\âmetros (nome,dias).")
end
end
return TRUE
end
Step C.c: ...data/talkactions/scripts/GOLDVIP.LUA
Code:
function onSay(cid, words, param)
if(words == "/addgoldvip")then
if(param ~= "")then
local params = list({"name", "days"}, string.explode(param, ',', 2))
local player = getPlayerByName(params["name"])
if(isPlayer(player) == TRUE)then
if(isNumber(params["days"]))then
local days = (params["days"]*3600*24)
if(isSilverVip(getPlayerAccount(player)))then
time1 = getSilverVipTime(getPlayerAccount(player))
doPlayerSendTextMessage(cid, 19, "Esta conta j\á possui "..timeString(time1).." de Silver VIP, n\ão sendo assim poss\ível adicionar dias de Gold Vip.")
else
doAddGoldVipTime(getPlayerAccount(player), days)
end
else
doPlayerSendCancel(cid, "Quantidade de dias deve ser n\úmerica.")
end
else
doPlayerSendCancel(cid, "O Player n\ão est\á online.")
end
else
doPlayerSendCancel(cid, "Comando requer par\âmetros (nome,dias).")
end
end
return TRUE
end
Silver/Gold VIP door
Step A: ...data/actions/actions.xml
Code:
<!-- VIP -->
<action actionid="9001" script="silvervipdoor.lua"/>
<action actionid="9002" script="goldvipdoor.lua"/>
Step A: ...data/actions/scripts/SILVERVIPDOOR.LUA
Silver VIP door:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
accountName = getPlayerAccount(cid)
if(isSilverVip(accountName) or isGoldVip(accountName))then
if getCreaturePosition(cid).y < toPosition.y then
doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
else
doTeleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z}, TRUE)
end
if(isSilverVip(accountName))then
doCreatureSay(cid, "Welcome Silver VIP Player!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), 10)
else
doCreatureSay(cid, "Welcome Gold VIP Player!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), 10)
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here. Buy VIP on the WEB.")
end
return TRUE
end
Step A: ...data/actions/scripts/GOLDVIPDOOR.LUA
Gold VIP door:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
accountName = getPlayerAccount(cid)
if(isGoldVip(accountName))then
time = getGoldVipTime(accountName)
if(time > 0) == TRUE then
if getCreaturePosition(cid).y < toPosition.y then
doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
else
doTeleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z}, TRUE)
end
doCreatureSay(cid, "Welcome Gold VIP Player!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), 10)
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here. Buy VIP on the WEB.")
end
return TRUE
end
A GOLD VIP PLAYER IS ALLOWED TO PASS THROUGH SILVER VIP DOOR!
A GOLD VIP PLAYER IS ALLOWED TO PASS THROUGH SILVER VIP DOOR!
Since the website part is too enormous, I'm attaching the files here.
Download:
via Attachment: View attachment htdocs.rar
via 2shared: 2shared - download htdocs.rar
via 4shared: 4shared.com - online file sharing and storage - download htdocs.rar
SQL part
Add to you OTs database:
Code:
CREATE TABLE IF NOT EXISTS `z_shop_history_silvervip` (
`id` int(11) NOT NULL auto_increment,
`to_name` varchar(255) NOT NULL default '0',
`to_account` int(11) NOT NULL default '0',
`from_nick` varchar(255) NOT NULL,
`from_account` int(11) NOT NULL default '0',
`price` int(11) NOT NULL default '0',
`sVIP_days` int(11) NOT NULL default '0',
`trans_state` varchar(255) NOT NULL,
`trans_start` int(11) NOT NULL default '0',
`trans_real` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=45 ;
CREATE TABLE IF NOT EXISTS `z_shop_history_goldvip` (
`id` int(11) NOT NULL auto_increment,
`to_name` varchar(255) NOT NULL default '0',
`to_account` int(11) NOT NULL default '0',
`from_nick` varchar(255) NOT NULL,
`from_account` int(11) NOT NULL default '0',
`price` int(11) NOT NULL default '0',
`gVIP_days` int(11) NOT NULL default '0',
`trans_state` varchar(255) NOT NULL,
`trans_start` int(11) NOT NULL default '0',
`trans_real` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
ALTER TABLE `accounts` ADD `silverviptime` BIGINT( 20 ) NOT NULL ;
ALTER TABLE `accounts` ADD `goldviptime` BIGINT( 20 ) NOT NULL ;
That should be it, please, report bugs, it worked fine hereeace: but maybe I forgot to post something here
Oncoming Update:
-Upgrade vip from silver to gold.
-Silver/Gold tiles.
-PM any ideas.
Known Bugs:
-On website, Gold VIP Points cost is shown = Silver VIP Points cost.
Fixing:
1.open htdocs/shopsystem.php;
2.go to the end of the line number 274 (ctrl+g);
3.search for "por '.$sVIP['points'].' points"
4.replace it for "por '.$gVIP['points'].' points"
Regards
Note: edited from Azi's VIP System (http://otland.net/f163/best-vip-system-functions-vip-account-30286/)
door edited from Shawak's [Release] VIP System (http://otland.net/f81/release-vip-system-44986/)
thx to 'em
Last edited: