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

i would like to know what scripting command to use to do this:

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Reaction score
186
i want to use command to set storage value of player
donno like if this player storage value is like that ( i need to know how to edit his storage value) then d
 
Credits to Kekox (http://otland.net/f132/talkaction-storagevalue-help-50235/#post504490)

setStorage.lua
Code:
--- 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
Code:
<talkaction words="/setstorage" event="script" value="setStorage.lua"/>

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

Ex:
/storage Kekox, 15511, -1
 
:), thx. i thought so but wasnt sure.hhehe.
so shouln't it be like that if getPlayerStorageValue(cid) == blablabal
if i want to make somthng according to player storage?
 
-1 is the default value on a storage. All character storages are -1 until changed.
So for example if we are doing a simple first items script, it would go something like this.

Code:
function onLogin(cid)

local storageValue = 12345 [B]-- this is the storage value we will use[/B]

if getPlayerStorageValue(cid, storageValue) == -1 then [B]-- this line checks if they have already been given the storage value, in this case if they have received their first items yet[/B]
doPlayerAddItem(cid,2120,1) [B]-- rope[/B]
doPlayerAddItem(cid,2554,1) [B]-- shovel These lines give the player their items.[/B]
doPlayerAddItem(cid,2152,10) [B]-- 10 platinum coins[/B]
setPlayerStorageValue(cid, storageValue, 1) [B]-- This line gives the player the storage value[/B]

end
return TRUE
end
 
Back
Top Bottom