• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua script [VIP]

ADM24horas

New Member
Joined
Oct 4, 2015
Messages
70
Reaction score
0
hello guys, I tried several systems that puts the [ VIP ] + name, and so far not found a fucional system and come to you a wonderful staff . I got this script from my vip system only when der use add storage + name and when the vip end the name disappeared , although if someone has named [ VIP ] Morphy not create another character with Morphy name. They understand?

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local days,removeOnUse = 5000,true

local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, 23510)
local timenow = os.time()
local time = getPlayerStorageValue(cid, 23510) - os.time() <= 0 and timenow + daysvalue or storageplayer + daysvalue

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")
setPlayerStorageValue(cid, 23510, time)
local quantity = math.floor((getPlayerStorageValue(cid, 23510) - timenow)/(24 * 60 * 60))
doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
if removeOnUse == true then doRemoveItem(item.uid, 1) end
return true
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getCreatureName(cid)
local days = 12 -- dias que serمo adicionados
local strg = 23510 -- valor da sua storage
local strg_n = 23510 -- nمo precisa editar
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, strg)
local timenow = os.time()
  if getPlayerStorageValue(cid, strg) - 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, strg, time)
local quantity = math.floor((getPlayerStorageValue(cid, strg) - timenow)/(24 * 60 * 60))
  doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))
  doPlayerAddPremiumDays(cid, 30)
doRemoveItem(item.uid, 1)
  if getPlayerStorageValue(cid, strg_n) < 1  then
  setPlayerStorageValue(cid, strg_n, 1)
  db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..name.."' WHERE `id` = "..getPlayerGUID(cid)..";")
  doRemoveCreature(cid) 
  else
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seus dias foram acrescentados e seu nome ja foi alterado.")
  end
return TRUE
end
 
Last edited by a moderator:
Back
Top