Merge branch 'nightly' into 1.4.0-prep
This commit is contained in:
@@ -52,14 +52,16 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been changed by the server`);
|
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been changed by the server`);
|
||||||
natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition);
|
natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition);
|
||||||
natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
|
natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
|
||||||
natives.setBlipMarkerLongDistance(businessData.blipId, true);
|
natives.setBlipMarkerLongDistance(businessData.blipId, false);
|
||||||
|
natives.setBlipAsShortRange(tempBusinessData.blipId, true);
|
||||||
natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`);
|
natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`);
|
||||||
} else {
|
} else {
|
||||||
let blipId = natives.addBlipForCoord(entrancePosition);
|
let blipId = natives.addBlipForCoord(entrancePosition);
|
||||||
if(blipId) {
|
if(blipId) {
|
||||||
businessData.blipId = blipId;
|
businessData.blipId = blipId;
|
||||||
natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
|
natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
|
||||||
natives.setBlipMarkerLongDistance(businessData.blipId, true);
|
natives.setBlipMarkerLongDistance(businessData.blipId, false);
|
||||||
|
natives.setBlipAsShortRange(tempBusinessData.blipId, true);
|
||||||
natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`);
|
natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`);
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
||||||
@@ -73,7 +75,8 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
|
|||||||
if(blipId) {
|
if(blipId) {
|
||||||
tempBusinessData.blipId = blipId;
|
tempBusinessData.blipId = blipId;
|
||||||
natives.changeBlipSprite(tempBusinessData.blipId, blipModel);
|
natives.changeBlipSprite(tempBusinessData.blipId, blipModel);
|
||||||
natives.setBlipMarkerLongDistance(tempBusinessData.blipId, true);
|
natives.setBlipMarkerLongDistance(tempBusinessData.blipId, false);
|
||||||
|
natives.setBlipAsShortRange(tempBusinessData.blipId, true);
|
||||||
natives.changeBlipNameFromAscii(tempBusinessData.blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
|
natives.changeBlipNameFromAscii(tempBusinessData.blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
|
||||||
}
|
}
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ function unBindChatBoxKeys() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function receiveChatBoxMessageFromServer(messageString, colour) {
|
function receiveChatBoxMessageFromServer(messageString, colour) {
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`);
|
||||||
let colouredString = replaceColoursInMessage(messageString);
|
let colouredString = replaceColoursInMessage(messageString);
|
||||||
|
|
||||||
if(bottomMessageIndex >= chatBoxHistory.length-1) {
|
if(bottomMessageIndex >= chatBoxHistory.length-1) {
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ function onProcess(event, deltaTime) {
|
|||||||
processGameSpecifics();
|
processGameSpecifics();
|
||||||
processNearbyPickups();
|
processNearbyPickups();
|
||||||
processVehiclePurchasing();
|
processVehiclePurchasing();
|
||||||
processVehicleFires();
|
//processVehicleFires();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -224,4 +224,11 @@ function onLocalPlayerSwitchWeapon(oldWeapon, newWeapon) {
|
|||||||
function onCameraProcess(event) {
|
function onCameraProcess(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function onChatOutput(event, messageText, colour) {
|
||||||
|
//event.preventDefault();
|
||||||
|
//receiveChatBoxMessageFromServer(messageText, colour);
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -13,10 +13,10 @@ function processSync(event, deltaTime) {
|
|||||||
sendNetworkEventToServer("vrr.plr.pos", localPlayer.position);
|
sendNetworkEventToServer("vrr.plr.pos", localPlayer.position);
|
||||||
sendNetworkEventToServer("vrr.plr.rot", localPlayer.heading);
|
sendNetworkEventToServer("vrr.plr.rot", localPlayer.heading);
|
||||||
|
|
||||||
if(localPlayer.vehicle != null) {
|
//if(localPlayer.vehicle != null) {
|
||||||
sendNetworkEventToServer("vrr.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position);
|
// sendNetworkEventToServer("vrr.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position);
|
||||||
sendNetworkEventToServer("vrr.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading);
|
// sendNetworkEventToServer("vrr.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(localPlayer.health <= 0) {
|
if(localPlayer.health <= 0) {
|
||||||
|
|||||||
@@ -1765,9 +1765,9 @@ function buyFromBusinessCommand(command, params, client) {
|
|||||||
|
|
||||||
if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand("inv")) {
|
if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand("inv")) {
|
||||||
let keyData = getPlayerKeyBindForCommand("inv");
|
let keyData = getPlayerKeyBindForCommand("inv");
|
||||||
messagePlayerNewbieTip(client, getLocaleString(client, "ViewInventoryKeyPressTip"), `{ALTCOLOUR}${getKeyNameFromId(keyData.key)}{MAINCOLOUR}`);
|
messagePlayerNewbieTip(client, getLocaleString(client, "ViewInventoryKeyPressTip", `{ALTCOLOUR}${getKeyNameFromId(keyData.key)}{MAINCOLOUR}`));
|
||||||
} else {
|
} else {
|
||||||
messagePlayerNewbieTip(client, getLocaleString(client, "ViewInventoryKeyPressTip"), `{ALTCOLOUR}/inv{MAINCOLOUR}`);
|
messagePlayerNewbieTip(client, getLocaleString(client, "ViewInventoryKeyPressTip", `{ALTCOLOUR}/inv{MAINCOLOUR}`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,29 +13,36 @@ function initChatScript() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function processPlayerChat(client, messageText) {
|
function processPlayerChat(client, messageText) {
|
||||||
if(!getPlayerData(client)) {
|
if(!isConsole(client)) {
|
||||||
messagePlayerError(client, "You need to login before you can chat!");
|
if(!getPlayerData(client)) {
|
||||||
return false;
|
messagePlayerError(client, "You need to login before you can chat!");
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(!isPlayerLoggedIn(client)) {
|
if(!isPlayerLoggedIn(client)) {
|
||||||
messagePlayerError(client, "You need to login before you can chat!");
|
messagePlayerError(client, "You need to login before you can chat!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isPlayerSpawned(client)) {
|
if(!isPlayerSpawned(client)) {
|
||||||
messagePlayerError(client, "You need to spawn before you can chat!");
|
messagePlayerError(client, "You need to spawn before you can chat!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isPlayerMuted(client)) {
|
if(isPlayerMuted(client)) {
|
||||||
messagePlayerError(client, "You are muted and can't chat!");
|
messagePlayerError(client, "You are muted and can't chat!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
messageText = messageText.substring(0, 128);
|
|
||||||
|
|
||||||
|
messageText = messageText.substring(0, 128);
|
||||||
|
messagePlayerNormal(null, `💬 ${getCharacterFullName(client)}: ${messageText}`);
|
||||||
|
} else {
|
||||||
|
messagePlayerNormal(null, `🛡️ (ADMIN) - ${messageText}`);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for(let i in clients) {
|
||||||
@@ -46,8 +53,8 @@ function processPlayerChat(client, messageText) {
|
|||||||
messagePlayerNormal(clients[i], `💬 ${getCharacterFullName(client)}: [#FFFFFF]${translatedText}${original}`, clients[i], getColourByName("mediumGrey"));
|
messagePlayerNormal(clients[i], `💬 ${getCharacterFullName(client)}: [#FFFFFF]${translatedText}${original}`, clients[i], getColourByName("mediumGrey"));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
messagePlayerNormal(null, `💬 ${getCharacterFullName(client)}: ${messageText}`);
|
|
||||||
messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: ${messageText}`);
|
//messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: ${messageText}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -520,9 +520,8 @@ function sendPlayerRemoveFromVehicle(client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendChatBoxMessageToPlayer(client, message, colour) {
|
function sendChatBoxMessageToPlayer(client, messageText, colour) {
|
||||||
sendNetworkEventToPlayer("vrr.m", client, message, colour)
|
messageClient(messageText, client, colour);
|
||||||
//messageClient(message, client, colour);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -80,29 +80,27 @@ function initConfigScript() {
|
|||||||
logToConsole(LOG_DEBUG, "[VRR.Config]: Loading global config ...");
|
logToConsole(LOG_DEBUG, "[VRR.Config]: Loading global config ...");
|
||||||
loadGlobalConfig();
|
loadGlobalConfig();
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config]: Loading server config ...");
|
logToConsole(LOG_INFO, "[VRR.Config]: Loading server config ...");
|
||||||
serverConfig = loadServerConfigFromGameAndPort(server.game, server.port, getMultiplayerMod());
|
serverConfig = loadServerConfigFromGameAndPort(server.game, server.port, getMultiplayerMod());
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config]: Applying server config ...");
|
logToConsole(LOG_INFO, "[VRR.Config]: Applying server config ...");
|
||||||
|
getServerConfig().fallingSnow = intToBool(toInteger(server.getCVar("fallingsnow")));
|
||||||
getServerConfig().fallingSnow = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("FallingSnow"));
|
getServerConfig().groundSnow = intToBool(toInteger(server.getCVar("groundsnow")));
|
||||||
getServerConfig().groundSnow = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("GroundSnow"));
|
getServerConfig().useGUI = intToBool(toInteger(server.getCVar("gui")));
|
||||||
getServerConfig().useGUI = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("GUI"));
|
getServerConfig().showLogo = false;
|
||||||
getServerConfig().showLogo = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("Logo"));
|
getServerConfig().testerOnly = intToBool(toInteger(server.getCVar("testeronly")));
|
||||||
getServerConfig().testerOnly = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("Testing"));
|
getServerConfig().discordEnabled = false;
|
||||||
getServerConfig().discordEnabled = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("DiscordBot"));
|
getServerConfig().createJobPickups = intToBool(toInteger(server.getCVar("jobpickups")));
|
||||||
getServerConfig().createJobPickups = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("JobPickups"));
|
getServerConfig().createBusinessPickups = intToBool(toInteger(server.getCVar("businesspickups")));
|
||||||
getServerConfig().createBusinessPickups = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("BusinessPickups"));
|
getServerConfig().createHousePickups = intToBool(toInteger(server.getCVar("housepickups")));
|
||||||
getServerConfig().createHousePickups = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("HousePickups"));
|
getServerConfig().createJobBlips = intToBool(toInteger(server.getCVar("jobblips")));
|
||||||
getServerConfig().createJobBlips = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("JobBlips"));
|
getServerConfig().createBusinessBlips = intToBool(toInteger(server.getCVar("businessblips")));
|
||||||
getServerConfig().createBusinessBlips = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("BusinessBlips"));
|
getServerConfig().createHouseBlips = intToBool(toInteger(server.getCVar("houseblips")));
|
||||||
getServerConfig().createHouseBlips = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("HouseBlips"));
|
getServerConfig().useRealTime = intToBool(toInteger(server.getCVar("realtime")));
|
||||||
getServerConfig().useRealTime = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("RealTime"));
|
getServerConfig().antiCheat.enabled = intToBool(toInteger(server.getCVar("anticheat")));
|
||||||
getServerConfig().antiCheat.enabled = hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("Anticheat"));
|
|
||||||
|
|
||||||
applyConfigToServer(serverConfig);
|
applyConfigToServer(serverConfig);
|
||||||
|
logToConsole(LOG_DEBUG, "[VRR.Config]: Server config applied successfully!");
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Config]: All config loaded and applied successfully!");
|
|
||||||
|
|
||||||
logToConsole(LOG_INFO, "[VRR.Config]: Config script initialized!");
|
logToConsole(LOG_INFO, "[VRR.Config]: Config script initialized!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,15 @@ function messagePlayerNormal(client, messageText, colour = COLOUR_WHITE) {
|
|||||||
// logToConsole(LOG_INFO, `${removeColoursInMessage(messageText)}`);
|
// logToConsole(LOG_INFO, `${removeColoursInMessage(messageText)}`);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
sendChatBoxMessageToPlayer(client, messageText, colour);
|
messageText = replaceColoursInMessage(messageText);
|
||||||
|
|
||||||
|
if(client == null) {
|
||||||
|
message(messageText, colour);
|
||||||
|
} else {
|
||||||
|
messageClient(messageText, client, colour);
|
||||||
|
}
|
||||||
|
|
||||||
|
//sendChatBoxMessageToPlayer(client, messageText, colour);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user