login screen light modus
This commit is contained in:
@@ -31,6 +31,18 @@ export default function (globalData: IGlobalData): void {
|
||||
|
||||
mp.events.add('CEF:Login_RequestPlayerName', () => {
|
||||
if (loginBrowser) {
|
||||
// 5:30 - 21:00
|
||||
var time = mp.game.time.getLocalTime(0, 0, 0, 0, 0, 0);
|
||||
var date: Date = new Date(time.year, time.month, time.day, time.hour, time.minute, time.second);
|
||||
var from: Date = new Date(time.year, time.month, time.day, 5, 30, 0);
|
||||
var to: Date = new Date(time.year, time.month, time.day, 21, 0, 0);
|
||||
|
||||
mp.gui.chat.push(JSON.stringify(time));
|
||||
|
||||
if (!(date > from && date < to)) { // in Zeitspanne um Light-Modus auszumachen
|
||||
loginBrowser.execute("disableLightMode();");
|
||||
}
|
||||
|
||||
loginBrowser.execute(`setPlayerName("${localPlayer.name}");`);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user