os.date("%R") crashes Garry's Mod

If run on either server-side or client-side, os.date("%R") crashes the game entirely.

Try:


lua_run_cl print(os.date("%R"))

Try %H:%M

I know, doofus, however I think it is important that %R is also fixed.

Well no one is going to help you if you insult them :downs:

What is %R even supposed to do?

[lua]print( “%R”, os.date( “%R” ) )
print( “%H:%M”, os.date( “%H:%M” ) )[/lua]


Running lua script '*untitled.lua' : Sun Jun 13 18:39:55 2010
%R	
%H:%M	18:39
End lua script : Sun Jun 13 18:39:55 2010
Execution time : 0.003(s)

%R is replaced by the time in 24 hour notation (%H:%M).

I think invalid args crashes it. I’m not sure if os.date is the same as STRFTIME() in Garry’s mod. Garry’s might of changed it.

 **[Os.date

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Os.date)**

If you didn’t know that already…
But most of them can be replaced by the others too.

I’m not sure either if it is even worth fixing, as they can be easily replaced by the other ones(I think?)

Well either way, remove it as a possible argument or fix it.

It’s built in to Lua… I don’t think it’s so smart to replace it at all then.

If run clientside, it will cause clients to crash. Wasn’t the “exit” command blocked for this reason?

I need a command similar to “exit” because I wish for my admins to be able to restart the server, so I might consider using os.time("%R").

However, this could definitely be used for servers to crash players they didn’t like.

Also: Can “exit” be unblocked for serverside use?

How about just adding a server-side command designed for rebooting it instead of re-adding one that isn’t meant for such a purpose?

How about finding me a way to reboot easily in lua, not using an exploit of some sort?

_restart, perhaps?

gm_command or however the module was named.

It’s blocked, doofus.

Yeah I know you can do it via module, but I don’t see why it’s blocked in the first place.

game.ConsoleCommand("_restart
") is not blocked.

Interesting workaround you got there.

Thanks!

EDIT: Nevermind, is not a workaround.

Jeez, you need to stop calling people “Doofus” it’s not nice for people who are trying to help you.

This is true.
I think people should not help him if he continuous.