Use locales for random tips (unfinished)

This commit is contained in:
Vortrex
2022-06-12 09:20:08 -05:00
parent 3ef91171f1
commit 519928bf6b

View File

@@ -237,14 +237,14 @@ function checkPayDays() {
// ===========================================================================
function showRandomTipToAllPlayers() {
let tipId = getRandom(0, randomTips.length-1);
let clients = getClients();
for (let i in clients) {
if (isClientInitialized(clients[i])) {
if (isPlayerLoggedIn(clients[i]) && isPlayerSpawned(clients[i])) {
if (!doesPlayerHaveRandomTipsDisabled(clients[i])) {
messagePlayerTimedRandomTip(null, randomTips[tipId]);
let localeId = getPlayerLocaleId(clients[i]);
let tipId = getRandom(0, getServerData().localeStrings[localeId]["RandomTips"].length - 1);
messagePlayerTip(clients[i], getGroupedLocaleString(clients[i], "RandomTips", tipId));
}
}
}