• 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!

Lua [SQLite] -=[TFS]=- 0.4 8.60 How can I fix this script with problem in storage vip

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
(getPlayerStorageValue(cid, 13545)

Lua:
function onSay(cid, words, param)
local level = getPlayerLevel(cid)
local vocation = getPlayerVocationName(cid)
local health, maxhealth = getCreatureHealth(cid), getCreatureMaxHealth(cid)
local mana, maxmana = getCreatureMana(cid), getCreatureMaxMana(cid)
local balance, pdays = getPlayerBalance(cid), getPlayerPremiumDays(cid)
local fist, club, sword, axe = getPlayerSkillLevel(cid, 0), getPlayerSkillLevel(cid, 1), getPlayerSkillLevel(cid, 2), getPlayerSkillLevel(cid, 3)
local distance, shield, fishing, magic =  getPlayerSkillLevel(cid, 4), getPlayerSkillLevel(cid, 5), getPlayerSkillLevel(cid, 6), getPlayerMagLevel(cid)
local lvldodge = getPlayerStorageValue(cid, 98798644)
local lvlcrit  = getPlayerStorageValue(cid, 48903)
local lvlatk = getPlayerStorageValue(cid, 48904)
local days = getPlayerStorageValue(cid, 13545)
local reset = getPlayerStorageValue(cid, 54676)
local cap = getPlayerFreeCap(cid)
local msg = "Vocation: "..vocation.."\nLevel: ".. level .."\nHP: ".. health .."/".. maxhealth .."\nMP: ".. mana .."/".. maxmana .."\nCapacity: ".. cap .."\nBalance: "..balance.."\nPremium Days: "..pdays.."\nDodge Level: ".. lvldodge .."\nCritical Level: ".. lvlcrit .."\nBOOSTER ATK: ".. lvlatk .."\nMagic Level: ".. magic .."\n[VIP] Days: ".. days .." \nReset Count: ".. reset .." \n\nFist: ".. fist .."\nClub: ".. club .."\nSword: ".. sword .."\nAxe: ".. axe .."\nDistance: ".. distance .."\nShield: ".. shield .."\nFishing: ".. fishing ..""
doPlayerPopupFYI(cid, msg)
return true
end

I have 30 days VIP



Screenshot_1.png
 
Solution
It looks more like a timestamp, You should calculate diff between now and that.
Lua:
local vipEndTime = getPlayerStorageValue(cid, 13545)
local vipSeconds = math.max(0, vipEndTime - os.time())
local days = math.ceil(vipSeconds / 86400)
It looks more like a timestamp, You should calculate diff between now and that.
Lua:
local vipEndTime = getPlayerStorageValue(cid, 13545)
local vipSeconds = math.max(0, vipEndTime - os.time())
local days = math.ceil(vipSeconds / 86400)
 
Solution
Lua:
function onSay(cid, words, param)
    local level = getPlayerLevel(cid)
    local vocation = getPlayerVocationName(cid)
    local health, maxhealth = getCreatureHealth(cid), getCreatureMaxHealth(cid)
    local mana, maxmana = getCreatureMana(cid), getCreatureMaxMana(cid)
    local balance, pdays = getPlayerBalance(cid), getPlayerPremiumDays(cid)
    local fist, club, sword, axe = getPlayerSkillLevel(cid, 0), getPlayerSkillLevel(cid, 1), getPlayerSkillLevel(cid, 2), getPlayerSkillLevel(cid, 3)
    local distance, shield, fishing, magic = getPlayerSkillLevel(cid, 4), getPlayerSkillLevel(cid, 5), getPlayerSkillLevel(cid, 6), getPlayerMagLevel(cid)
    local lvldodge = getPlayerStorageValue(cid, 98798644)
    local lvlcrit = getPlayerStorageValue(cid, 48903)
    local lvlatk = getPlayerStorageValue(cid, 48904)
    
    local vipEndTime = getPlayerStorageValue(cid, 13545)
    local vipSeconds = math.max(0, vipEndTime - os.time())
    local days = math.ceil(vipSeconds / 86400)
    
    local reset = getPlayerStorageValue(cid, 54676)
    local cap = getPlayerFreeCap(cid)
    
    local msg = "Vocation: " .. vocation .. "\nLevel: " .. level .. "\nHP: " .. health .. "/" .. maxhealth .. "\nMP: " .. mana .. "/" .. maxmana .. "\nCapacity: " .. cap .. "\nBalance: " .. balance .. "\nPremium Days: " .. pdays .. "\nDodge Level: " .. lvldodge .. "\nCritical Level: " .. lvlcrit .. "\nBOOSTER ATK: " .. lvlatk .. "\nMagic Level: " .. magic .. "\n[VIP] Days: " .. days .. " \nReset Count: " .. reset .. " \n\nFist: " .. fist .. "\nClub: " .. club .. "\nSword: " .. sword .. "\nAxe: " .. axe .. "\nDistance: " .. distance .. "\nShield: " .. shield .. "\nFishing: " .. fishing .. ""
    
    doPlayerPopupFYI(cid, msg)
    return true
end
 

Similar threads

Back
Top