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

[SQL] UPDATE player_storage. HELP

szyszek05

New Member
Joined
Sep 21, 2008
Messages
35
Reaction score
0
Hello
I have problem, because I want update player storage and set key 'xxx'.
What is the command?
I wait for answer :)
 
If you want it to set a storage on login for players that are over a certain level try something like this

In data > creaturescripts > login.lua
Under function onLogin(cid)

Add:
Code:
[B][COLOR=#0000ff]if[/COLOR][/B] getPlayerLevel[COLOR=#000080]([/COLOR]cid[COLOR=#000080])[/COLOR] [COLOR=#000080]>=[/COLOR] 20 [B][COLOR=#0000ff]then[/COLOR][/B]
    doCreatureSetStorage[COLOR=#000080]([/COLOR]cid, key, value[COLOR=#000080])[/COLOR]
[B][COLOR=#0000ff]end[/COLOR][/B]

getPlayerLevel(cid) >= 20
If the player is higher or equal to level 20

doCreatureSetStorage(cid, key, value)
Change key and value to what ever you want.
 
Last edited:
I want get for players vip access key:1111, and if you start game in me server, u don't have this storage xD

Ehh, so you want all players that plays in your server right NOW get that storage, or you want all NEW Players from NOW on to get it or you want ALL Players that play your server get it?
 
Lua:
if getPlayerLevel(cid) >= 20 then
    doCreatureSetStorage(cid, key, value)
end
This is bad. You should try do this in this style:
Lua:
if (getPlayerLevel(cid) >= 20 and getCreatureStorage(cid, key) == -1) then
    doCreatureSetStorage(cid, key, value)
end
 
Back
Top