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

how to increase storage value by 1

Ziggy

Member
Joined
Aug 11, 2007
Messages
49
Reaction score
6
I know it is
setPlayerStorageValue(cid, 21005, 2) but how do i make it like
setPlayerStorageValue(cid, 21005, +1) so it increases by 1, it doesnt actually set it
 
thank you but my idea seems unscriptable, what I wanted to do was to make a quest to visit all the cities (by pulling a lever in each city temple) but I did it a different way so its alright, thanks though
 
But the way medargo said is right, should work..

Code:
setPlayerStorageValue(cid, 21005, 1)

Means storage 21005 is equal to 1.

Code:
getPlayerStorageValue(cid, 21005)

returns the value of 21005 wich is 1.

Code:
setPlayerStorageValue(cid, 21005, getPlayerStorageValue(cid, 21005) + 1)

getPlayerStorageValue(cid, 21005) + 1 its equal to 1 + 1 so the new valeu will be 2.. get it?
 
what about if storage doesn't exist?
Code:
setPlayerStorageValue(cid, 21005, math.max(1,getPlayerStorageValue(cid,21005)+1))
 
Back
Top