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

C++ HELP Script Verifying Storage

willks123

New Member
Joined
Dec 31, 2012
Messages
64
Reaction score
2
How do I edit this script to check the value of Storage?
function onLogin(player)
local targetVocation = config[player:getVocation():getId()]
if not targetVocation then
return true
end

if player:getLastLoginSaved() ~= 0 then
return true
end

for i = 1, #targetVocation.items do
player:addItem(targetVocation.items[1], targetVocation.items[2])
end

if getPlayerStorage(15002) <= 0 and getplayerStorage(15003) >= 1 then
player:setStorageValue(15002, 1) -- Mining Skill
player:setStorageValue(15003, 0) -- Mining Skill Tries
return true
end

local backpack = player:addItem(1988)
if not backpack then
return true
end

for i = 1, #targetVocation.container do
backpack:addItem(targetVocation.container[1], targetVocation.container[2])
end
return true
end

It's there in the part of Mining Skill, I tried to create a check but I do not understand script uhahuahua


Well, what happens is that when the player logs in the first time he has to set the value of STORAGE 15002 to 1 and 15003 to 0. But it has to have a check, because only if I log it set to 1 Again .
 
Solution
if getPlayerStorage(15002) <= 0 and getplayerStorage(15003) >= 1 then
In this line, either write it like this
Lua:
if getPlayerStorageValue(player, 15002) <= 0 and getplayerStorageValue(player, 15003) >= 1 then
Or like this
Lua:
if player:getStorageValue(15002) <= 0 and player:getStorageValue(15003) >= 1 then
if getPlayerStorage(15002) <= 0 and getplayerStorage(15003) >= 1 then
In this line, either write it like this
Lua:
if getPlayerStorageValue(player, 15002) <= 0 and getplayerStorageValue(player, 15003) >= 1 then
Or like this
Lua:
if player:getStorageValue(15002) <= 0 and player:getStorageValue(15003) >= 1 then
 
Solution
Back
Top