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

Lua Command doPlayerStorageValue - need help

vakacjus

Lua & C++ Study.
Joined
Oct 23, 2008
Messages
260
Solutions
1
Reaction score
26
Location
Bydgoszcz, Poland
Hi,

Can u tell me how I can use this command and add storage from config +1 like :

I have storage 2000, 1
Using somethink
I have storage 2000, 2
and using, and using, ..., and using
I have storage 2000, 100
 
It's easy, just use the functions that TFS has already made :)

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local str = 2000
	doPlayerSetStorageValue(cid, str, getPlayerStorageValue(cid, str) +1) -- See what I did here
	doPlayerSendTextMessage(cid, 19, "The storage ".. str .."'s value is now ".. getPlayerStorageValue(cid, str) ..".")
	return true
end

Remember that new storages begins always with the value "-1"
 
Back
Top