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

Lua Command doPlayerStorageValue - need help

vakacjus

Lua & C++ Study.
Joined
Oct 23, 2008
Messages
255
Solutions
1
Reaction score
26
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"
 
and when I want to create 2 scripts that using same storage but difrent value. How can I rise value and then read it in 2 script?
 
Back
Top