Forum

> > CS2D > Scripts > LUA read the real time (os.date)
Forums overviewCS2D overview Scripts overviewLog in to reply

English LUA read the real time (os.date)

5 replies
To the start Previous 1 Next To the start

old LUA read the real time (os.date)

ReVoltage
User Off Offline

Quote
I want to know, is it possible to:
Can the lua read the real time in my computer?
"Read" the time, not "Show" the time
Example:
If the time 12:00 AM, it will do something
1
2
3
if os.date("%I:%M %p")=="12:00 AM" then
--blablabla
end
Something like that, i cant describe more
So is it possible to do this?
If it possible, i want to know how
Thx before

old Re: LUA read the real time (os.date)

ohaz
User Off Offline

Quote
It is possible. But it only reads the real time on the server (since Lua code is only run on the server). You can't read the client side real time.

old Re: LUA read the real time (os.date)

ReVoltage
User Off Offline

Quote
user ohaz has written
It is possible. But it only reads the real time on the server (since Lua code is only run on the server). You can't read the client side real time.

Sorry, i dont understand
Do you mean, its only read the hoster real time?
So it is possible, can tell me how to do this?

old Re: LUA read the real time (os.date)

Alistaire
User Off Offline

Quote
1
os.date("%c")

----

user oxytamine has written
Please, DC, disable os-like functions in Lua, I'm so tired of these endless exploits.


Yea, save systems are complete and utter exploits. Holy shit look how much they exploit.

old Re: LUA read the real time (os.date)

DC
Admin Off Offline

Quote
@user oxytamine: Scripts run on the server side only. Just check scripts written by others before you use them and your are safe. Also never run your server as root. Create a new user who only has access to the cs2d folder. This way you are pretty safe even if you don't check the scripts before using them (which I still wouldn't recommend though).
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview