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

[Talkaction] Storagevalue Help

blaisethunder

New Member
Joined
Aug 13, 2009
Messages
20
Reaction score
0
Please i need a talkaction for remove or back to a normal storage value of a player..

Rep + for who help
 
Here you are..
setStorage.lua
Lua:
--- Storage script by kekox
function onSay(cid, words, param, channel)
local t = string.explode(param, ",")
local player = getPlayerByName(t[1])
      if t[1] ~= nil and t[2] ~= nil and t[3] ~= nil then
         setPlayerStorageValue(player, t[2], t[3])
      else
      doPlayerSendCancel(cid, "Command requieres three params.")
      end
      return TRUE
end

Talkactions.xml
PHP:
<talkaction words="/setstorage" event="script" value="setStorage.lua"/>

It works like this:
/storage <name>, <storage>, <value>

Ex:
/storage Kekox, 15511, -1
 
try
Lua:
--- Storage script by kekox
function onSay(cid, words, param, channel)
local t = string.explode(param, ",")
local player = getPlayerByName(t[1])
local cidPos = getPlayerPosition(cid)
      if t[1] ~= nil and t[2] ~= nil and t[3] ~= nil then
         setPlayerStorageValue(player, t[2], t[3])
         doPlayerSendTextMessage(cid, "You added storage "..t[2].." to "..t[1]..". [Value "..t[3].."].")
         doSendMagicEffect(cidPos, CONST_ME_MAGIC_BLUE)
         doSendMagicEffect(player, CONST_ME_MAGIC_RED)
      else
      doPlayerSendCancel(cid, "Command requieres three params.")
      end
      return TRUE
end
 
isnt there already sometinh like this in tfs?

like if you do /storage PLAYER, STORAGEVALUE you return what value the player have of that storage

but if you do /storage PLAYER, STORAGEVALUE, VALUE you set the value
 
Back
Top