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

setplayerstorage don't work 7.6

kaszanalubizryc

New Member
Joined
Sep 10, 2015
Messages
148
Reaction score
1
hello i have problems setpalyerstoragevalue dont work

Code:
function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
local backpack = doPlayerAddItem(cid, 1988, 1) -- adds a backpack
if getPlayerVocation(cid) == 1 then -- Sorc
doAddContainerItem(backpack, 2789, 100) -- backpack
doPlayerAddItem(cid, 2464, 1) -- adds a chain armor
-- here you can add more shit
elseif getPlayerVocation(cid) == 2 then -- Druid
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
-- here you can add more shit
elseif getPlayerVocation(cid) == 3 then -- Paladin
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
-- here you can add more shit
elseif getPlayerVocation(cid) == 4 then -- Knight
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
-- here you can add more shit
else
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
end
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end
 
It happen on every server sometimes adding items onLogin doesn't work. The solution for this will be calling this func with addEvent and small delay
 
hello i have problems setpalyerstoragevalue dont work

Code:
function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
local backpack = doPlayerAddItem(cid, 1988, 1) -- adds a backpack
if getPlayerVocation(cid) == 1 then -- Sorc
doAddContainerItem(backpack, 2789, 100) -- backpack
doPlayerAddItem(cid, 2464, 1) -- adds a chain armor
-- here you can add more shit
elseif getPlayerVocation(cid) == 2 then -- Druid
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
-- here you can add more shit
elseif getPlayerVocation(cid) == 3 then -- Paladin
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
-- here you can add more shit
elseif getPlayerVocation(cid) == 4 then -- Knight
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
-- here you can add more shit
else
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
end
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end
Did you try setCreatureStorageValue and getCreatureStorageValue?
 
Back
Top