Esse topico vou mostrar como adicionar o Script !buyvip no seu otserv.
Em
data/talkactions/scripts crie um arquivo
buyvip.lua
Show Content
Spoiler
function onSay(cid, words, param)
local price = 1000000
if doPlayerRemoveMoney(cid, price) == TRUE then
local days = 15
local s = 29000
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, s)
local timenow = os.time()
if getPlayerStorageValue(cid, s) - os.time() <= 0 then
time = timenow + daysvalue
else
time = storageplayer + daysvalue
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")
setPlayerStorageValue(cid, s, time)
local quantity = math.floor((getPlayerStorageValue(cid, s) - timenow)/(24 * 60 * 60))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa de "..price.." gp's para colocar vip.")
end
return TRUE
end
Registra no
Talkactions.xml
Código:
<talkaction words="!buyvip" event="script" value="buyvip.lua"/>
Agora na pasta
data/movements/scripts crie um arquivo
passagembuyvip.lua
Show Content
Spoiler
function onStepIn(cid, item, position, fromPosition)
local config = {
msgDenied = "Vc nao e vip , comprepelo comando !buyvip.",
msgWelcome = "Seja Bem Vindo a Area vip."
}
local s = 29000
if getPlayerStorageValue(cid, s) - os.time() <= 0 then
doTeleportThing(cid, fromPosition, true)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgDenied)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
return TRUE
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgWelcome)
return TRUE
end
Registra no
movements.xml
Código:
<movevent type="StepIn" uniqueid="13850" event="script" value="passagembuyvip.lua"/>
Creditos:
Vodkart