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

Set all players storage value

avalock

New Member
Joined
Feb 5, 2013
Messages
16
Reaction score
3
Location
Great Britain
Hey guys, new to this site so sorry if this is in the wrong section, and just wondered if there is any function to change every character on the database's storage value of a certain id to a new value? kind of like setGlobalStorageValue() But So they have individual values after this has been reset to zero again. Any help would be apretiated! Thanks guys :D
 
Lua:
function onLogin(cid)
local storage = 29993 --id of storage
setPlayerStorageValue(cid, storage, 0)
return true
end

It will add storage 0 to player onLogin into game.
 
Ah yea i could do that but i wanted it a weekly thing so its a repeatable "quest" but that will reset for all players in my database on the same day at the same time :L Is this possible within LUA? Like a function to just mass reset storage? or would i have to make my host server run a CMD to execute a MySQL Query? Thanks again :D
 
globalevents > init.lua after onStartup...

Lua:
now = os.date('*t')
if (tonumber(now.wday) == 2) then --(1 - Sunday 2 - Monday 3 - Tuesday 4 - Wednesday 5 - Thursday 6 - Friday 7 - Saturday)
db.executeQuery("DELETE FROM `player_storage` WHERE `key`.`333333` = 1;")
end


You should check query, i dont have any database atm so i cant see the names of table...

It will be awesome if you can post screen from database players_storage smth like that.
 
Last edited:
Back
Top Bottom