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

Storage value +1 help!

eardrums

Member
Joined
May 27, 2010
Messages
94
Solutions
1
Reaction score
10
So I'm making this script for a little lock picking skill through actions and I was wondering if its possible to do something.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

        if itemEx.itemid == 1746 and
           itemEx.uid == 2026 and
           getPlayerStorageValue(cid, 50000) == -1 then
           setPlayerStorageValue(cid, 50000, 1)
           doPlayerAddItem(cid, 2087, 1)
           doRemoveItem(cid, item.uid, 1)
           doSendMagicEffect(getCreaturePosition(cid), CONST_ME_CRAPS)
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You advanced to lock picking 1.')
           elseif itemEx.itemid == 1746 and
           itemEx.uid == 2026 and
           getPlayerStorageValue(cid, 50000) >= 1 then
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'It is empty.')       


           elseif itemEx.itemid == 6894 and
           itemEx.uid == 2028 and
           getPlayerStorageValue(cid, 50000) == 1 then
           setPlayerStorageValue(cid, 50000, 2)
           doRemoveItem(cid, item.uid, 1)
           doSendMagicEffect(getCreaturePosition(cid), CONST_ME_CRAPS)
           elseif itemEx.itemid == 6894 and
           itemEx.uid == 2028 and
           getPlayerStorageValue(cid, 50000) == -1 then
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You must be lock picking 1 or higher.')
           elseif itemEx.itemid == 6894 and
           itemEx.uid == 2028 and
           getPlayerStorageValue(cid, 50000) == 2 then
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'The door is already unlocked.')           
end
return true
end

Okay so I would like to know if theres a way to add 1 to the storage value. For example:
getPlayerStorageValue(cid, 50000) == 1 then
setPlayerStorageValue(cid, 50000, 1)
is it possible to like make my storage value +1 so like writing in the value like this setPlayerStorageValue(cid, 50000, +1) so if my storage value is at 1 it would go up to 2 and if its at 2 it would go up to 3. I hope there is a way that i can do that because i tried to put +1 down but that doesnt work ofc.

Thanks!
 
Back
Top