RevScript Vip Time por Storage Funcionando

jackye

Member
Messages
62
Points
163
Hola a todos les traigo un post mio para que puedan utilizarlo ustedes es un sistema vip totalmente original en revScript

Este script fue testeado en un otserverbr.

Empecemos

primero que nada te vas a a player.lua y buscas estas lineas

-- Stamina Bonus
if configManager.getBoolean(configKeys.STAMINA_SYSTEM) then
useStamina(self)
local staminaMinutes = self:getStamina()
if staminaMinutes > 2340 and self:isPremium() then
exp = exp * 1.5
self:setStaminaXpBoost(150)
elseif staminaMinutes <= 840 then
exp = exp * 0.5 --TODO destroy loot of people with 840- stamina
self:setStaminaXpBoost(50)
else
self:setStaminaXpBoost(100)
end
end
Click to expand...

debajo de esta linea agregas lo siguiente:

esta es una condicion para que cuando el player sea vip pueda tener mas exp
if self:getStorageValue(3000) - os.time() > 0 then ---- el storage a dar al jugador
exp = exp * 1.5 -- exp extra que te gustaria que gane el player vip
end


Despues nos iremos a data/script/actions/vipaction.lua --- el nombre que deseen agregarle

y agregas este codigo

local vip = Action()

function vip.onUse(player, item, fromPosition, target, toPosition, isHotkey)

local days = 30 -- dias que seran adicionados

local daysvalue = days * 24 * 60 * 60

local storageplayer = player:getStorageValue(3000)

local timenow = os.time()


doPlayerRemoveItem(cid, 7634, 100)

if player:getStorageValue(3000) - os.time() <= 0 then --- storage lo puedes modificar si ya lo tienes en uso

time = timenow + daysvalue

else

time = storageplayer + daysvalue

end


player:sendTextMessage(TALKTYPE_ORANGE_1, "Fueron adicionados ".. days .." dias de VIP en su character.")

player:setStorageValue(3000, time)

local quantity = math.floor((player:getStorageValue(3000) - timenow)/(24 * 60 * 60))



player:sendTextMessage(TALKTYPE_ORANGE_1, "Usted Tiene ".. quantity .." dias de VIP restantes.") --- mensaje

item:remove(1) --- le removera el item

addEvent(function(cid)
local player = Player(cid)
if player then
player:remove()
end
end, 2000, player.uid)

return TRUE

end

vip:id(16101) --- itemq que deseas que te haga vip es por 30 dias
vip:register()
Click to expand...

Después te vas a data/script/movement y agregas otro archivo con el nombre que gustes

local vipp = MoveEvent()

function vipp.onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if player == nil then return false end


if player:getStorageValue(3000) - os.time() <= 0 then
player:sendTextMessage(MESSAGE_INFO_DESCR, "solo player vips - Only Vip Players")
player:teleportTo(fromPosition)
else

local back = {x = 1112, y = 651, z = 7} --- posicion de la zona vip o teleport es un pisol.
player:teleportTo(back)
player:sendTextMessage(MESSAGE_INFO_DESCR, "Bienvenido Al Area Vip. - Welcome Vip Are")
end



return true
end
vipp:type("stepin")
vipp:aid(16101)
vipp:register()
Click to expand...

Despues el talktion este es para que los usuarios puedan ver su vip time

local vip = TalkAction("!vip")

function vip.onSay(player, words, param)
local left, d, h, m, s = (player:getStorageValue(3000) - os.time()), 0, 0, 0, 0
while left >= 86400 do
left = left - 86400
d = d+1
end
while left >= 3600 do
left = left - 3600
h = h + 1
end
while left >= 60 do
left = left - 60
m = m + 1
end
while left >= 1 do
left = left - 1
s = s+1
end
player:sendTextMessage(22, "VIP Player Informations:\n\nYour VIP time left:\nDays: "..d.."\nHours: "..h.."\nMinutes: "..m.."\nSeconds: "..s.."")
end

vip:separator(" ")
vip:register()



Att: God Mazatlan - Marcuz :)
 
¡Felicitaciones, su Tema ha sido aprobado!
Muchas gracias por tu contribución, nosotros en Open Games Community te agradecemos.
Tu contenido seguramente ayudará a muchos otros, has ganado +1 Like.
 
este el id que necesitas tu lo pudes modificar aqui tienes este es el piso mira


local vipp = MoveEvent()

function vipp.onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if player == nil then return false end


if player:getStorageValue(3000) - os.time() <= 0 then
player:sendTextMessage(MESSAGE_INFO_DESCR, "solo player vips - Only Vip Players")
player:teleportTo(fromPosition)
else

local back = {x = 1112, y = 651, z = 7} --- posicion de la zona vip o teleport es un piso.
player:teleportTo(back)
player:sendTextMessage(MESSAGE_INFO_DESCR, "Bienvenido Al Area Vip. - Welcome Vip Are")
end



return true
end
vipp:type("stepin")
vipp:aid(16101)
vipp:register()
 
como le puedo agregar a la base de datos que me aparesca la vip ejemplo como esta
ALTER TABLE `accounts`
ADD COLUMN `viplastday` int(10) NOT NULL DEFAULT 0 AFTER `lastday`,
ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0 AFTER `lastday`;

pero aqui nose como seria pues hasme el favor de decirme
 

Tibia Server Lists

#1 FEATURED US Ultron OT 1,686 / 5,000Online EXPStages PROTO8.6 ENGINEUltron OT RANK PTS5.9 +100% VOTES0 #2 FEATURED US Nefera 140 / 0Online EXPx1 PROTO15.20 ENGINECrystal Server RANK PTS5.1 +100% VOTES0 #3 FEATURED ES Deixis 0 / 0Offline EXPStages PROTO1098 ENGINETFS RANK PTS3.7 +100% VOTES1 #4 FEATURED ES Maeli 7 / 150Online EXPx10 PROTO10.98 ENGINETFS 1.4.2 RANK PTS3.7 +100% VOTES0 #5 MX Marlboro War 47 / 300Online EXP999 PROTO8.6 ENGINETFS 0.3.7 RANK PTS5.5 -33% VOTES0 #6 BR Tibinha YurOts 16 / 150Online EXPStages PROTO7.4 ENGINEYurOTS 1.5 RANK PTS5.2 -14% VOTES0 #7 US Halera 2 / 0Online EXPStages PROTO10.98 ENGINETFS 1.4.2 RANK PTS4.9 -83% VOTES0 #8 BR Exordion Legacy 60 / 2,000Online EXPx2 PROTO7.72 ENGINEExordion RANK PTS4.9 +100% VOTES0 #9 PL Lubelski 3 / 1,000Online EXP200 PROTO7.6 ENGINELubelskiOTS 2.56.0 RANK PTS4.6 -15% VOTES0 #10 DE DBU Online 0 / 400Online EXP11 PROTO8.6 ENGINETFS 1.0 RANK PTS4.3 +100% VOTES0 #11 PL ReWar 0 / 2,000Online EXPcustom PROTO8.6 ENGINEOther RANK PTS4.3 0% VOTES0 #12 PL Velesta 0 / 1,000Offline EXP20 PROTO8.0 ENGINETFS 1.4.2 RANK PTS4.3 -98% VOTES0 #13 ES JustRL FreeTC 1530 16 / 250Online EXPx2 PROTO15.30 ENGINECrystal Server RANK PTS4.3 +100% VOTES0 #14 ES Farlia Global 2026 0 / 333Offline EXPx5 PROTO15.25 ENGINEFarliaServ 1.525 RANK PTS3.9 -22% VOTES0 #15 SE MortalisOT Custom 0 / 500Offline EXP100x -1.2x PROTO10.98 ENGINEMortalisOT V1 RANK PTS3.8 +100% VOTES0 #16 US Rommania 0 / 500Online EXPstages, x10 PROTO7.4 ENGINETFS 0.4 RANK PTS3.6 +100% VOTES0 #17 US BerethaOnline 2 / 2,000Online EXPStages PROTO10.98 ENGINETFS RANK PTS3.5 +100% VOTES0
Top