• 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 and DB] Table with decrease value

Dantarrix

Member
Joined
Aug 27, 2010
Messages
546
Reaction score
18
Location
Stgo, Chile
Hello OTLanders....

I'm here to ask you a short questions that i think i will have a correct answer until tomorrow...

1. How to add a value to a db table by a script?
db.executeQuery("UPDATE ~ ???

2. How to make that value to decrease while time is passing, only when server is online...

That's all... Thank you...
 
add a value or a column? do add a column you alter the table

ALTER players ADD blah blah blah make a search on mysql.com or something
 
2. How to make that value to decrease while time is passing, only when server is online...
Globalevents.
Lua:
config =
{
	storageId = 1000
}

function onThink(interval, lastExecution, thinkInterval)
	doSetStorage(config.storageId, math.min(0, getStorage(config.storageId)) + interval)
	return true
end
 
Back
Top