Change configs
This commit is contained in:
@@ -52,7 +52,7 @@ function whisperCommand(command, params, client) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function talkToNearbyPlayers(client, messageText) {
|
function talkToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClientsInRange(client.player.position, getServerConfig().talkDistance);
|
let clients = getClientsInRange(client.player.position, getGlobalConfig().talkDistance);
|
||||||
for(let i in clients) {
|
for(let i in clients) {
|
||||||
//if(clients[i] != client) {
|
//if(clients[i] != client) {
|
||||||
messageClientTalk(getClientFromPlayerElement(clients[i]), client, messageText);
|
messageClientTalk(getClientFromPlayerElement(clients[i]), client, messageText);
|
||||||
@@ -63,7 +63,7 @@ function talkToNearbyPlayers(client, messageText) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function whisperToNearbyPlayers(client, messageText) {
|
function whisperToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClientsInRange(client.player.position, getServerConfig().talkDistance);
|
let clients = getClientsInRange(client.player.position, getGlobalConfig().talkDistance);
|
||||||
for(let i in clients) {
|
for(let i in clients) {
|
||||||
//if(clients[i] != client) {
|
//if(clients[i] != client) {
|
||||||
messageClientWhisper(getClientFromPlayerElement(clients[i]), client, messageText);
|
messageClientWhisper(getClientFromPlayerElement(clients[i]), client, messageText);
|
||||||
@@ -74,7 +74,7 @@ function whisperToNearbyPlayers(client, messageText) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function shoutToNearbyPlayers(client, messageText) {
|
function shoutToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClientsInRange(client.player.position, getServerConfig().shoutDistance);
|
let clients = getClientsInRange(client.player.position, getGlobalConfig().shoutDistance);
|
||||||
for(let i in clients) {
|
for(let i in clients) {
|
||||||
//if(clients[i].index != client.index) {
|
//if(clients[i].index != client.index) {
|
||||||
messageClientShout(getClientFromPlayerElement(clients[i]), client, messageText);
|
messageClientShout(getClientFromPlayerElement(clients[i]), client, messageText);
|
||||||
@@ -85,7 +85,7 @@ function shoutToNearbyPlayers(client, messageText) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function doActionToNearbyPlayers(client, messageText) {
|
function doActionToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClientsInRange(client.player.position, getServerConfig().doActionDistance);
|
let clients = getClientsInRange(client.player.position, getGlobalConfig().doActionDistance);
|
||||||
for(let i in clients) {
|
for(let i in clients) {
|
||||||
//if(clients[i].index != client.index) {
|
//if(clients[i].index != client.index) {
|
||||||
messageClientDoAction(getClientFromPlayerElement(clients[i]), client, messageText);
|
messageClientDoAction(getClientFromPlayerElement(clients[i]), client, messageText);
|
||||||
@@ -96,7 +96,7 @@ function doActionToNearbyPlayers(client, messageText) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function meActionToNearbyPlayers(client, messageText) {
|
function meActionToNearbyPlayers(client, messageText) {
|
||||||
let clients = getClientsInRange(client.player.position, getServerConfig().meActionDistance);
|
let clients = getClientsInRange(client.player.position, getGlobalConfig().meActionDistance);
|
||||||
for(let i in clients) {
|
for(let i in clients) {
|
||||||
//if(clients[i].index != client.index) {
|
//if(clients[i].index != client.index) {
|
||||||
messageClientMeAction(getClientFromPlayerElement(clients[i]), client, messageText);
|
messageClientMeAction(getClientFromPlayerElement(clients[i]), client, messageText);
|
||||||
|
|||||||
@@ -19,6 +19,74 @@ function initClassScript() {
|
|||||||
|
|
||||||
function initClassTable() {
|
function initClassTable() {
|
||||||
let tempClasses = {
|
let tempClasses = {
|
||||||
|
serverConfigData: class {
|
||||||
|
constructor(dbAssoc) {
|
||||||
|
this.databaseId = 0;
|
||||||
|
this.name = "";
|
||||||
|
this.password = "";
|
||||||
|
|
||||||
|
this.newCharacter = {
|
||||||
|
spawnPosition = false,
|
||||||
|
spawnHeading = 0.0,
|
||||||
|
money = 0,
|
||||||
|
bank = 0,
|
||||||
|
skin = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
this.connectCameraPosition = false;
|
||||||
|
this.connectCameraLookAt = false;
|
||||||
|
this.hour = 0;
|
||||||
|
this.minute = 0
|
||||||
|
this.weather = 0
|
||||||
|
this.fallingSnow = false;
|
||||||
|
this.groundSnow = false;
|
||||||
|
this.useGUI = false;
|
||||||
|
this.guiColour = [0, 0, 0];
|
||||||
|
|
||||||
|
this.antiCheat = {
|
||||||
|
enabled: false,
|
||||||
|
checkGameScripts: false,
|
||||||
|
gameScriptWhiteList: [],
|
||||||
|
gameScriptBlackList: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
this.discordBotToken = "";
|
||||||
|
this.discordEnabled = false;
|
||||||
|
|
||||||
|
if(dbAssoc) {
|
||||||
|
this.databaseId = dbAssoc["svr_id"];
|
||||||
|
this.name = dbAssoc["svr_name"];
|
||||||
|
this.password = dbAssoc["svr_password"];
|
||||||
|
this.newCharacter = {
|
||||||
|
spawnPosition = toVector3(dbAssoc["svr_newchar_pos_x"], dbAssoc["svr_newchar_pos_y"], dbAssoc["svr_newchar_pos_z"]),
|
||||||
|
spawnHeading = dbAssoc["svr_newchar_rot_z"],
|
||||||
|
money = dbAssoc["svr_newchar_money"],
|
||||||
|
bank = dbAssoc["svr_newchar_bank"],
|
||||||
|
skin = dbAssoc["svr_newchar_skin"],
|
||||||
|
},
|
||||||
|
|
||||||
|
this.connectCameraPosition = toVector3(dbAssoc["svr_connectcam_pos_x"], dbAssoc["svr_connectcam_pos_y"], dbAssoc["svr_connectcam_pos_z"]);
|
||||||
|
this.connectCameraLookAt = toVector3(dbAssoc["svr_connectcam_lookat_x"], dbAssoc["svr_connectcam_lookat_y"], dbAssoc["svr_connectcam_lookat_z"]);
|
||||||
|
this.hour = toInteger(dbAssoc["svr_start_time_hour"]);
|
||||||
|
this.minute = toInteger(dbAssoc["svr_start_time_min"]);
|
||||||
|
this.weather = toInteger(dbAssoc["svr_start_weather"]);
|
||||||
|
this.fallingSnow = intToBool(dbAssoc["svr_start_snow_falling"]);
|
||||||
|
this.groundSnow = intToBool(dbAssoc["svr_start_snow_ground"]);
|
||||||
|
this.useGUI = intToBool(dbAssoc["svr_gui"]);
|
||||||
|
this.guiColour = [toInteger(dbAssoc["svr_gui_col1_r"]), toInteger(dbAssoc["svr_gui_col1_g"]), toInteger(dbAssoc["svr_gui_col1_b"])];
|
||||||
|
|
||||||
|
this.antiCheat = {
|
||||||
|
enabled: intToBool(dbAssoc["svr_ac_enabled"]),
|
||||||
|
checkGameScripts: intToBool(dbAssoc["svr_ac_check_scripts"]),
|
||||||
|
gameScriptWhiteList: [],
|
||||||
|
gameScriptBlackList: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
this.discordBotToken = "";
|
||||||
|
this.discordEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
clientData: class {
|
clientData: class {
|
||||||
constructor(client, accountData, subAccounts) {
|
constructor(client, accountData, subAccounts) {
|
||||||
this.accountData = accountData;
|
this.accountData = accountData;
|
||||||
@@ -131,6 +199,11 @@ function initClassTable() {
|
|||||||
this.spawnHeading = toFloat(subAccountAssoc["sacct_angle"]);
|
this.spawnHeading = toFloat(subAccountAssoc["sacct_angle"]);
|
||||||
this.lastLogin = toInteger(subAccountAssoc["sacct_last_login"]);
|
this.lastLogin = toInteger(subAccountAssoc["sacct_last_login"]);
|
||||||
|
|
||||||
|
this.clan = toInteger(subAccountAssoc["sacct_clan"]);
|
||||||
|
this.clanFlags = toInteger(subAccountAssoc["sacct_clan_flags"]);
|
||||||
|
this.clanRank = toInteger(subAccountAssoc["sacct_clan_rank"]);
|
||||||
|
this.clanTitle = toInteger(subAccountAssoc["sacct_clan_title"]);
|
||||||
|
|
||||||
this.isWorking = false;
|
this.isWorking = false;
|
||||||
this.jobUniform = this.skin;
|
this.jobUniform = this.skin;
|
||||||
this.lastJobVehicle = null;
|
this.lastJobVehicle = null;
|
||||||
@@ -547,3 +620,4 @@ function getClass(className) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -8,31 +8,10 @@
|
|||||||
// TYPE: Server (JavaScript)
|
// TYPE: Server (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
let serverConfig = {
|
let serverConfig = {};
|
||||||
useGUI: true,
|
|
||||||
name: "Asshat Gaming Roleplay",
|
let globalConfig = {
|
||||||
password: "LockedForStartup*128",
|
|
||||||
hour: 0,
|
|
||||||
minute: 0,
|
|
||||||
weather: 1,
|
|
||||||
fallingSnow: 0,
|
|
||||||
groundSnow: 0,
|
|
||||||
showLogo: true,
|
|
||||||
guiColour: [200, 200, 200],
|
|
||||||
antiCheat: {
|
|
||||||
enabled: true,
|
|
||||||
checkGameScripts: true,
|
|
||||||
gameScriptBlackList: [],
|
|
||||||
gameScriptWhiteList: [],
|
|
||||||
},
|
|
||||||
accountPasswordHash: "SHA512",
|
accountPasswordHash: "SHA512",
|
||||||
connectCameraPosition: false,
|
|
||||||
connectCameraLookAt: false,
|
|
||||||
newCharacter: {
|
|
||||||
spawnPosition: false,
|
|
||||||
spawnHeading: 0.0,
|
|
||||||
money: 0,
|
|
||||||
},
|
|
||||||
npcFarProximity: 100,
|
npcFarProximity: 100,
|
||||||
npcMediumProximity: 40,
|
npcMediumProximity: 40,
|
||||||
npcCloseProximity: 12,
|
npcCloseProximity: 12,
|
||||||
@@ -47,7 +26,21 @@ let serverConfig = {
|
|||||||
takeJobDistance: 5,
|
takeJobDistance: 5,
|
||||||
stopWorkingDistance: 10,
|
stopWorkingDistance: 10,
|
||||||
spawnCarDistance: 5,
|
spawnCarDistance: 5,
|
||||||
payAndSprayDistance: 5,
|
payAndSprayDistance: 5,
|
||||||
|
defaultKeybinds: [
|
||||||
|
new serverClasses.keyBindData(false, SDLK_i, "engine"),
|
||||||
|
new serverClasses.keyBindData(false, SDLK_k, "lights"),
|
||||||
|
new serverClasses.keyBindData(false, SDLK_l, "lock"),
|
||||||
|
new serverClasses.keyBindData(false, SDLK_f, "enter"),
|
||||||
|
new serverClasses.keyBindData(false, SDLK_g, "passenger"),
|
||||||
|
],
|
||||||
|
exitPropertyDistance: 3.0,
|
||||||
|
enterPropertyDistance: 3.0,
|
||||||
|
businessDimensionStart: 1000,
|
||||||
|
houseDimensionStart: 3000,
|
||||||
|
};
|
||||||
|
|
||||||
|
let gameConfig = {
|
||||||
blipSprites: [
|
blipSprites: [
|
||||||
false,
|
false,
|
||||||
{ // GTA III
|
{ // GTA III
|
||||||
@@ -201,32 +194,6 @@ let serverConfig = {
|
|||||||
info: 1,
|
info: 1,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// Not implemented yet
|
|
||||||
keybindText: {
|
|
||||||
actionKey: "E",
|
|
||||||
vehicleEngineKey: "I",
|
|
||||||
vehicleLightsKey: "K",
|
|
||||||
vehicleLocksKey: "L",
|
|
||||||
},
|
|
||||||
keybinds: {
|
|
||||||
actionKey: SDLK_e,
|
|
||||||
vehicleEngineKey: SDLK_e,
|
|
||||||
vehicleLightsKey: SDLK_k,
|
|
||||||
vehicleLocksKey: SDLK_l,
|
|
||||||
},
|
|
||||||
discordBotToken: "",
|
|
||||||
discordEnabled: false,
|
|
||||||
defaultKeybinds: [
|
|
||||||
new serverClasses.keyBindData(false, SDLK_i, "engine"),
|
|
||||||
new serverClasses.keyBindData(false, SDLK_k, "lights"),
|
|
||||||
new serverClasses.keyBindData(false, SDLK_l, "lock"),
|
|
||||||
new serverClasses.keyBindData(false, SDLK_f, "enter"),
|
|
||||||
new serverClasses.keyBindData(false, SDLK_g, "passenger"),
|
|
||||||
],
|
|
||||||
exitPropertyDistance: 3.0,
|
|
||||||
enterPropertyDistance: 3.0,
|
|
||||||
businessDimensionStart: 1000,
|
|
||||||
houseDimensionStart: 3000,
|
|
||||||
|
|
||||||
// THIS IS SCREEN HEIGHT, NOT ACTUAL DOOR POSITION IN THE WORLD
|
// THIS IS SCREEN HEIGHT, NOT ACTUAL DOOR POSITION IN THE WORLD
|
||||||
propertyLabelHeight: [
|
propertyLabelHeight: [
|
||||||
@@ -242,8 +209,8 @@ let serverConfig = {
|
|||||||
removedWorldObjects: [
|
removedWorldObjects: [
|
||||||
false,
|
false,
|
||||||
[
|
[
|
||||||
new serverClasses.removedWorldObjectData("fraightback04", new Vec3(1229.88, -84.8012, 13.4004), 10.0), // Truck trailer in Easy Credit Autos dealership parking lot
|
new serverClasses.removedWorldObjectData("fraightback04", new Vec3(1229.88, -84.8012, 13.4004), 50.0), // Truck trailer in Easy Credit Autos dealership parking lot
|
||||||
new serverClasses.removedWorldObjectData("fraightback03", new Vec3(1239.49, -68.0529, 11.6914), 10.0), // Truck trailer in Easy Credit Autos dealership parking lot
|
new serverClasses.removedWorldObjectData("fraightback03", new Vec3(1239.49, -68.0529, 11.6914), 50.0), // Truck trailer in Easy Credit Autos dealership parking lot
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@@ -257,46 +224,23 @@ let serverConfig = {
|
|||||||
|
|
||||||
function initConfigScript() {
|
function initConfigScript() {
|
||||||
console.log("[Asshat.Config]: Initializing config script ...");
|
console.log("[Asshat.Config]: Initializing config script ...");
|
||||||
|
serverConfig = loadServerConfig(server.game, server.port);
|
||||||
|
applyConfigToServer(serverConfig);
|
||||||
console.log("[Asshat.Config]: Config script initialized!");
|
console.log("[Asshat.Config]: Config script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function loadServerConfig() {
|
function loadServerConfigFromGameAndPort(gameId, port) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if(dbConnection) {
|
if(dbConnection) {
|
||||||
let dbQueryString = `SELECT * FROM svr_main WHERE svr_game = ${server.game} AND svr_port = ${server.port} LIMIT 1;`;
|
let dbQueryString = `SELECT * FROM svr_main WHERE svr_game = ${gameId} AND svr_port = ${port} LIMIT 1;`;
|
||||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
||||||
if(dbQuery) {
|
if(dbQuery) {
|
||||||
if(dbQuery.numRows > 0) {
|
if(dbQuery.numRows > 0) {
|
||||||
let dbAssoc = fetchQueryAssoc(dbQuery);
|
let dbAssoc = fetchQueryAssoc(dbQuery);
|
||||||
|
|
||||||
serverId = dbAssoc["svr_id"];
|
let tempServerConfigData = serverClasses.serverConfigData(dbAssoc);
|
||||||
getServerConfig().name = dbAssoc["svr_name"];
|
|
||||||
getServerConfig().password = dbAssoc["svr_password"];
|
|
||||||
getServerConfig().newCharacter.spawnPosition = toVector3(dbAssoc["svr_newchar_pos_x"], dbAssoc["svr_newchar_pos_y"], dbAssoc["svr_newchar_pos_z"]);
|
|
||||||
getServerConfig().newCharacter.spawnHeading = dbAssoc["svr_newchar_rot_z"];
|
|
||||||
getServerConfig().newCharacter.money = dbAssoc["svr_newchar_money"];
|
|
||||||
getServerConfig().newCharacter.bank = dbAssoc["svr_newchar_bank"];
|
|
||||||
getServerConfig().newCharacter.skin = dbAssoc["svr_newchar_skin"];
|
|
||||||
|
|
||||||
getServerConfig().connectCameraPosition = toVector3(dbAssoc["svr_connectcam_pos_x"], dbAssoc["svr_connectcam_pos_y"], dbAssoc["svr_connectcam_pos_z"]);
|
|
||||||
getServerConfig().connectCameraLookAt = toVector3(dbAssoc["svr_connectcam_lookat_x"], dbAssoc["svr_connectcam_lookat_y"], dbAssoc["svr_connectcam_lookat_z"]);
|
|
||||||
getServerConfig().hour = toInteger(dbAssoc["svr_start_time_hour"]);
|
|
||||||
getServerConfig().minute = toInteger(dbAssoc["svr_start_time_min"]);
|
|
||||||
getServerConfig().weather = toInteger(dbAssoc["svr_start_weather"]);
|
|
||||||
getServerConfig().fallingSnow = intToBool(dbAssoc["svr_start_snow_falling"]);
|
|
||||||
getServerConfig().groundSnow = intToBool(dbAssoc["svr_start_snow_ground"]);
|
|
||||||
getServerConfig().useGUI = intToBool(dbAssoc["svr_gui"]);
|
|
||||||
getServerConfig().guiColour = [toInteger(dbAssoc["svr_gui_col1_r"]), toInteger(dbAssoc["svr_gui_col1_g"]), toInteger(dbAssoc["svr_gui_col1_b"])];
|
|
||||||
|
|
||||||
getServerConfig().antiCheat.enabled = intToBool(dbAssoc["svr_ac_enabled"]);
|
|
||||||
getServerConfig().antiCheat.checkGameScripts = intToBool(dbAssoc["svr_ac_check_scripts"]);
|
|
||||||
|
|
||||||
getServerConfig().antiCheat.gameScriptWhiteList = loadAntiCheatGameScriptWhiteListFromDatabase(serverId);
|
|
||||||
getServerConfig().antiCheat.gameScriptBlackList = loadAntiCheatGameScriptBlackListFromDatabase(serverId);
|
|
||||||
|
|
||||||
applyConfigToServer();
|
|
||||||
|
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
}
|
}
|
||||||
@@ -305,6 +249,25 @@ function loadServerConfig() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function loadServerConfigFromId(tempServerId) {
|
||||||
|
let dbConnection = connectToDatabase();
|
||||||
|
if(dbConnection) {
|
||||||
|
let dbQueryString = `SELECT * FROM svr_main WHERE svr_id = ${tempServerId} LIMIT 1;`;
|
||||||
|
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
||||||
|
if(dbQuery) {
|
||||||
|
if(dbQuery.numRows > 0) {
|
||||||
|
let dbAssoc = fetchQueryAssoc(dbQuery);
|
||||||
|
let tempServerConfigData = serverClasses.serverConfigData(dbAssoc);
|
||||||
|
freeDatabaseQuery(dbQuery);
|
||||||
|
return tempServerConfigData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
disconnectFromDatabase(dbConnection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
function applyConfigToServer() {
|
function applyConfigToServer() {
|
||||||
@@ -319,18 +282,18 @@ function applyConfigToServer() {
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
function saveServerConfigToDatabase() {
|
function saveServerConfigToDatabase(serverConfigData) {
|
||||||
console.log(`[Asshat.Config]: Saving server configuration to database ...`);
|
console.log(`[Asshat.Config]: Saving server ${serverConfigData.databaseId} configuration to database ...`);
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if(dbConnection) {
|
if(dbConnection) {
|
||||||
let safeServerName = escapeDatabaseString(dbConnection, getServerConfig().name);
|
let safeServerName = escapeDatabaseString(dbConnection, serverConfigData.name);
|
||||||
let safePassword = escapeDatabaseString(dbConnection, getServerConfig().password);
|
let safePassword = escapeDatabaseString(dbConnection, serverConfigData.password);
|
||||||
|
|
||||||
let dbQueryString = `UPDATE svr_main SET svr_logo=${boolToInt(getServerConfig().showLogo)}, svr_gui=${boolToInt(getServerConfig().useGUI)}, svr_password='${safePassword}', svr_name='${safeServerName}', svr_start_time_hour=${getServerConfig().hour}, svr_start_time_min=${getServerConfig().minute}, svr_start_weather=${getServerConfig().weather}, svr_start_snow_falling=${boolToInt(getServerConfig().fallingSnow)}, svr_start_snow_ground=${boolToInt(getServerConfig().groundSnow)}, svr_newchar_pos_x=${getServerConfig().newCharacter.spawnPosition.x}, svr_newchar_pos_y=${getServerConfig().newCharacter.spawnPosition.y}, svr_newchar_pos_z=${getServerConfig().newCharacter.spawnPosition.z}, svr_newchar_rot_z=${getServerConfig().newCharacter.spawnHeading}, svr_newchar_money=${getServerConfig().newCharacter.money}, svr_newchar_skin=${getServerConfig().newCharacter.skin}, svr_gui_col1_r=${getServerConfig().guiColour[0]}, svr_gui_col1_g=${getServerConfig().guiColour[1]}, svr_gui_col1_b=${getServerConfig().guiColour[2]} WHERE svr_id = ${serverId}`;
|
let dbQueryString = `UPDATE svr_main SET svr_logo=${boolToInt(serverConfigData.showLogo)}, svr_gui=${boolToInt(getServerConfig().useGUI)}, svr_password='${safePassword}', svr_name='${safeServerName}', svr_start_time_hour=${serverConfigData.hour}, svr_start_time_min=${serverConfigData.minute}, svr_start_weather=${serverConfigData.weather}, svr_start_snow_falling=${boolToInt(serverConfigData.fallingSnow)}, svr_start_snow_ground=${boolToInt(serverConfigData.groundSnow)}, svr_newchar_pos_x=${serverConfigData.newCharacter.spawnPosition.x}, svr_newchar_pos_y=${serverConfigData.newCharacter.spawnPosition.y}, svr_newchar_pos_z=${serverConfigData.newCharacter.spawnPosition.z}, svr_newchar_rot_z=${serverConfigData.newCharacter.spawnHeading}, svr_newchar_money=${serverConfigData.newCharacter.money}, svr_newchar_skin=${serverConfigData.newCharacter.skin}, svr_gui_col1_r=${serverConfigData.guiColour[0]}, svr_gui_col1_g=${serverConfigData.guiColour[1]}, svr_gui_col1_b=${serverConfigData.guiColour[2]} WHERE svr_id = ${serverConfigData.databaseId}`;
|
||||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
console.log(`[Asshat.Config]: Server configuration saved to database!`);
|
console.log(`[Asshat.Config]: Server ${serverConfigData.databaseId} configuration saved to database!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -341,6 +304,24 @@ function getServerConfig() {
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function getGameConfig() {
|
||||||
|
return gameConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function getGlobalConfig() {
|
||||||
|
return globalConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function getServerId() {
|
||||||
|
return getServerConfig().databaseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
function setTimeCommand(command, params, client) {
|
function setTimeCommand(command, params, client) {
|
||||||
if(getCommand(command).requireLogin) {
|
if(getCommand(command).requireLogin) {
|
||||||
if(!isClientLoggedIn(client)) {
|
if(!isClientLoggedIn(client)) {
|
||||||
@@ -408,9 +389,9 @@ function setWeatherCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
gta.forceWeather(weatherId);
|
gta.forceWeather(toInteger(weatherId));
|
||||||
|
|
||||||
messageAdminAction(`${client.name} set the weather to [#AAAAAA]${weatherNames[server.game][weatherId]}`);
|
messageAdminAction(`${client.name} set the weather to [#AAAAAA]${weatherNames[server.game][toInteger(weatherId)]}`);
|
||||||
updateServerRules();
|
updateServerRules();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ function loadHousesFromDatabase() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function createHouseCommand(command, params, client) {
|
function createHouseCommand(command, params, client) {
|
||||||
let tempHouseData = createHouse(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getServerConfig().pickupModels[getServerGame()].house, getServerConfig().blipSprites[getServerGame()].house, getPlayerInterior(client), getPlayerVirtualWorld(client));
|
let tempHouseData = createHouse(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getGameConfig().pickupModels[getServerGame()].house, getGameConfig().blipSprites[getServerGame()].house, getPlayerInterior(client), getPlayerVirtualWorld(client));
|
||||||
getServerData().houses.push(tempHouseData);
|
getServerData().houses.push(tempHouseData);
|
||||||
|
|
||||||
sendHouseLabelToPlayers(getServerData().houses.length-1);
|
sendHouseLabelToPlayers(getServerData().houses.length-1);
|
||||||
@@ -128,7 +128,6 @@ function setHouseClanCommand(command, params, client) {
|
|||||||
messageClientSuccess(client, `House ${getHouseData(houseId).name} owner set to the [#AAAAAA]${getClanData(clanId).name} [#FFFFFF]clan!`);
|
messageClientSuccess(client, `House ${getHouseData(houseId).name} owner set to the [#AAAAAA]${getClanData(clanId).name} [#FFFFFF]clan!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function setHousePickupCommand(command, params, client) {
|
function setHousePickupCommand(command, params, client) {
|
||||||
@@ -141,13 +140,13 @@ function setHousePickupCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isNaN(typeParam)) {
|
if(isNaN(typeParam)) {
|
||||||
if(isNull(getServerConfig().pickupModels[getServerGame()][typeParam])) {
|
if(isNull(getGameConfig().pickupModels[getServerGame()][typeParam])) {
|
||||||
messageClientError(client, "Invalid house type! Use a house type name or a pickup model ID");
|
messageClientError(client, "Invalid house type! Use a house type name or a pickup model ID");
|
||||||
messageClientInfo(client, `Pickup Types: [#AAAAAA]${Object.keys(getServerConfig().pickupModels[getServerGame()]).join(", ")}`)
|
messageClientInfo(client, `Pickup Types: [#AAAAAA]${Object.keys(getGameConfig().pickupModels[getServerGame()]).join(", ")}`)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getHouseData(houseId).entrancePickupModel = getServerConfig().pickupModels[getServerGame()][typeParam];
|
getHouseData(houseId).entrancePickupModel = getGameConfig().pickupModels[getServerGame()][typeParam];
|
||||||
} else {
|
} else {
|
||||||
getHouseData(houseId).entrancePickupModel = toInteger(typeParam);
|
getHouseData(houseId).entrancePickupModel = toInteger(typeParam);
|
||||||
}
|
}
|
||||||
@@ -175,13 +174,13 @@ function setHouseBlipCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isNaN(typeParam)) {
|
if(isNaN(typeParam)) {
|
||||||
if(isNull(getServerConfig().blipSprites[getServerGame()][typeParam])) {
|
if(isNull(getGameConfig().blipSprites[getServerGame()][typeParam])) {
|
||||||
messageClientError(client, "Invalid house type! Use a house type name or a blip image ID");
|
messageClientError(client, "Invalid house type! Use a house type name or a blip image ID");
|
||||||
messageClientInfo(client, `Pickup Types: [#AAAAAA]${Object.keys(getServerConfig().blipSprites[getServerGame()]).join(", ")}`)
|
messageClientInfo(client, `Pickup Types: [#AAAAAA]${Object.keys(getGameConfig().blipSprites[getServerGame()]).join(", ")}`)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getHouseData(houseId).entranceBlipModel = getServerConfig().blipSprites[getServerGame()][typeParam];
|
getHouseData(houseId).entranceBlipModel = getGameConfig().blipSprites[getServerGame()][typeParam];
|
||||||
} else {
|
} else {
|
||||||
getHouseData(houseId).entranceBlipModel = toInteger(typeParam);
|
getHouseData(houseId).entranceBlipModel = toInteger(typeParam);
|
||||||
}
|
}
|
||||||
@@ -294,7 +293,7 @@ function createHouse(description, entrancePosition, exitPosition, entrancePickup
|
|||||||
tempHouseData.exitDimension = exitVirtualWorld;
|
tempHouseData.exitDimension = exitVirtualWorld;
|
||||||
|
|
||||||
if(entrancePickupModel != -1) {
|
if(entrancePickupModel != -1) {
|
||||||
tempHouseData.entrancePickup = gta.createPickup(entrancePickupModel, entrancePosition, getServerConfig().pickupTypes[getServerGame()].house);
|
tempHouseData.entrancePickup = gta.createPickup(entrancePickupModel, entrancePosition, getGameConfig().pickupTypes[getServerGame()].house);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entranceBlipModel != -1) {
|
if(entranceBlipModel != -1) {
|
||||||
@@ -392,7 +391,7 @@ function createAllHouseBlips() {
|
|||||||
|
|
||||||
function createHouseEntrancePickup(houseId) {
|
function createHouseEntrancePickup(houseId) {
|
||||||
if(getServerData().houses[houseId].entrancePickupModel != -1) {
|
if(getServerData().houses[houseId].entrancePickupModel != -1) {
|
||||||
let pickupModelId = getServerConfig().pickupModels[getServerGame()].house;
|
let pickupModelId = getGameConfig().pickupModels[getServerGame()].house;
|
||||||
|
|
||||||
if(getServerData().houses[houseId].entrancePickupModel != 0) {
|
if(getServerData().houses[houseId].entrancePickupModel != 0) {
|
||||||
pickupModelId = getServerData().houses[houseId].entrancePickupModel;
|
pickupModelId = getServerData().houses[houseId].entrancePickupModel;
|
||||||
@@ -435,8 +434,14 @@ function getHouseOwnerTypeText(ownerType) {
|
|||||||
return "player";
|
return "player";
|
||||||
|
|
||||||
case AG_BIZOWNER_NONE:
|
case AG_BIZOWNER_NONE:
|
||||||
return "not owned";
|
return "not owned";
|
||||||
|
|
||||||
|
case AG_BIZOWNER_PUBLIC:
|
||||||
|
return "not owned";
|
||||||
|
|
||||||
|
case AG_BIZOWNER_JOB:
|
||||||
|
return "job";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
@@ -462,14 +467,22 @@ function getHouseInfoCommand(command, params, client) {
|
|||||||
ownerName = getClanData(getHouseData(houseId).ownerId).name;
|
ownerName = getClanData(getHouseData(houseId).ownerId).name;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AG_BIZOWNER_PLAYER:
|
case AG_HOUSEOWNER_PLAYER:
|
||||||
let accountData = loadAccountFromId(getHouseData(houseId).ownerId);
|
let accountData = loadAccountFromId(getHouseData(houseId).ownerId);
|
||||||
ownerName = `${accountData.name} [${accountData.databaseId}]`;
|
ownerName = `${accountData.name} [${accountData.databaseId}]`;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AG_BIZOWNER_NONE:
|
case AG_HOUSEOWNER_NONE:
|
||||||
ownerName = "None"
|
ownerName = "None";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case AG_HOUSEOWNER_PUBLIC:
|
||||||
|
ownerName = "Public";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AG_HOUSEOWNER_JOB:
|
||||||
|
ownerName = getJobData(getHouseData(houseId).ownerId).name;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
messageClientNormal(client, `🏠 [#11CC11][House Info] [#FFFFFF]Description: [#AAAAAA]${getHouseData(houseId).description}, [#FFFFFF]Owner: [#AAAAAA]${ownerName} (${getHouseOwnerTypeText(getHouseData(houseId).ownerType)}), [#FFFFFF]Locked: [#AAAAAA]${getYesNoFromBool(intToBool(getHouseData(houseId).locked))}, [#FFFFFF]ID: [#AAAAAA]${houseId}/${getHouseData(houseId).databaseId}`);
|
messageClientNormal(client, `🏠 [#11CC11][House Info] [#FFFFFF]Description: [#AAAAAA]${getHouseData(houseId).description}, [#FFFFFF]Owner: [#AAAAAA]${ownerName} (${getHouseOwnerTypeText(getHouseData(houseId).ownerType)}), [#FFFFFF]Locked: [#AAAAAA]${getYesNoFromBool(intToBool(getHouseData(houseId).locked))}, [#FFFFFF]ID: [#AAAAAA]${houseId}/${getHouseData(houseId).databaseId}`);
|
||||||
@@ -527,7 +540,7 @@ function sendAllHouseLabelsToPlayer(client) {
|
|||||||
for(let j = 0 ; j < housesPerNetworkEvent ; j++) {
|
for(let j = 0 ; j < housesPerNetworkEvent ; j++) {
|
||||||
let tempHouseId = (i*housesPerNetworkEvent)+j;
|
let tempHouseId = (i*housesPerNetworkEvent)+j;
|
||||||
if(typeof getServerData().houses[tempHouseId] != "undefined") {
|
if(typeof getServerData().houses[tempHouseId] != "undefined") {
|
||||||
tempHouseLabels.push([tempHouseId, getServerData().houses[tempHouseId].entrancePosition, getServerConfig().propertyLabelHeight[getServerGame()], getServerData().houses[tempHouseId].description, getServerData().houses[tempHouseId].locked, false]);
|
tempHouseLabels.push([tempHouseId, getServerData().houses[tempHouseId].entrancePosition, getGlobalConfig().propertyLabelHeight[getServerGame()], getServerData().houses[tempHouseId].description, getServerData().houses[tempHouseId].locked, false]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
triggerNetworkEvent("ag.houselabel.all", client, tempHouseLabels);
|
triggerNetworkEvent("ag.houselabel.all", client, tempHouseLabels);
|
||||||
@@ -538,7 +551,7 @@ function sendAllHouseLabelsToPlayer(client) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function sendHouseLabelToPlayers(houseId) {
|
function sendHouseLabelToPlayers(houseId) {
|
||||||
triggerNetworkEvent("ag.houselabel.add", null, houseId, getServerData().houses[houseId].entrancePosition, getServerConfig().propertyLabelHeight[getServerGame()], getServerData().houses[houseId].description, getServerData().houses[houseId].locked, false);
|
triggerNetworkEvent("ag.houselabel.add", null, houseId, getServerData().houses[houseId].entrancePosition, getGlobalConfig().propertyLabelHeight[getServerGame()], getServerData().houses[houseId].description, getServerData().houses[houseId].locked, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ function takeJobCommand(command, params, client) {
|
|||||||
let closestJobLocation = getClosestJobLocation(client.player.position);
|
let closestJobLocation = getClosestJobLocation(client.player.position);
|
||||||
let jobData = getJobData(closestJobLocation.job);
|
let jobData = getJobData(closestJobLocation.job);
|
||||||
|
|
||||||
if(closestJobLocation.position.distance(client.player.position) > getServerConfig().takeJobDistance) {
|
if(closestJobLocation.position.distance(client.player.position) > getGlobalConfig().takeJobDistance) {
|
||||||
messageClientError(client, "There are no job points close enough!");
|
messageClientError(client, "There are no job points close enough!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -372,7 +372,7 @@ function startWorkingCommand(command, params, client) {
|
|||||||
let closestJobLocation = getClosestJobLocation(client.player.position);
|
let closestJobLocation = getClosestJobLocation(client.player.position);
|
||||||
let jobData = getJobData(closestJobLocation.job);
|
let jobData = getJobData(closestJobLocation.job);
|
||||||
|
|
||||||
if(closestJobLocation.position.distance(client.player.position) > getServerConfig().startWorkingDistance) {
|
if(closestJobLocation.position.distance(client.player.position) > getGlobalConfig().startWorkingDistance) {
|
||||||
messageClientError(client, "There are no job points close enough!");
|
messageClientError(client, "There are no job points close enough!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ function submitBugReportCommand(command, params, client) {
|
|||||||
function enterExitPropertyCommand(command, params, client) {
|
function enterExitPropertyCommand(command, params, client) {
|
||||||
if(isPlayerInAnyHouse(client)) {
|
if(isPlayerInAnyHouse(client)) {
|
||||||
let inHouse = getServerData().houses[getPlayerHouse(client)];
|
let inHouse = getServerData().houses[getPlayerHouse(client)];
|
||||||
if(getDistance(inHouse.exitPosition, getPlayerPosition(client)) <= getServerConfig().exitPropertyDistance) {
|
if(getDistance(inHouse.exitPosition, getPlayerPosition(client)) <= getGlobalConfig().exitPropertyDistance) {
|
||||||
if(inHouse.locked) {
|
if(inHouse.locked) {
|
||||||
meActionToNearbyPlayers(client, "tries to open the house door but fails because it's locked");
|
meActionToNearbyPlayers(client, "tries to open the house door but fails because it's locked");
|
||||||
return false;
|
return false;
|
||||||
@@ -122,7 +122,7 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
|
|
||||||
if(isPlayerInAnyBusiness(client)) {
|
if(isPlayerInAnyBusiness(client)) {
|
||||||
let inBusiness = getServerData().businesses[getPlayerBusiness(client)];
|
let inBusiness = getServerData().businesses[getPlayerBusiness(client)];
|
||||||
if(getDistance(inBusiness.exitPosition, getPlayerPosition(client)) <= getServerConfig().exitPropertyDistance) {
|
if(getDistance(inBusiness.exitPosition, getPlayerPosition(client)) <= getGlobalConfig().exitPropertyDistance) {
|
||||||
if(inBusiness.locked) {
|
if(inBusiness.locked) {
|
||||||
meActionToNearbyPlayers(client, "tries to open the business door but fails because it's locked");
|
meActionToNearbyPlayers(client, "tries to open the business door but fails because it's locked");
|
||||||
return false;
|
return false;
|
||||||
@@ -138,7 +138,7 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
if(getServerData().businesses.length > 0) {
|
if(getServerData().businesses.length > 0) {
|
||||||
let closestBusinessId = getClosestBusinessEntrance(getPlayerPosition(client));
|
let closestBusinessId = getClosestBusinessEntrance(getPlayerPosition(client));
|
||||||
let closestBusiness = getBusinessData(closestBusinessId)
|
let closestBusiness = getBusinessData(closestBusinessId)
|
||||||
if(getDistance(closestBusiness.entrancePosition, getPlayerPosition(client)) <= getServerConfig().enterPropertyDistance) {
|
if(getDistance(closestBusiness.entrancePosition, getPlayerPosition(client)) <= getGlobalConfig().enterPropertyDistance) {
|
||||||
if(!doesBusinessHaveInterior(closestBusinessId)) {
|
if(!doesBusinessHaveInterior(closestBusinessId)) {
|
||||||
messageClientAlert(client, "This business does not have an interior.");
|
messageClientAlert(client, "This business does not have an interior.");
|
||||||
messageClientTip(client, "You can use business commands at the door.");
|
messageClientTip(client, "You can use business commands at the door.");
|
||||||
@@ -151,7 +151,7 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
meActionToNearbyPlayers(client, "opens the door and enters the business");
|
meActionToNearbyPlayers(client, "opens the door and enters the business");
|
||||||
triggerNetworkEvent("ag.enterProperty", client, closestBusiness.exitPosition, closestBusiness.exitRotation, closestBusiness.exitInterior, closestBusinessId+getServerConfig().businessDimensionStart);
|
triggerNetworkEvent("ag.enterProperty", client, closestBusiness.exitPosition, closestBusiness.exitRotation, closestBusiness.exitInterior, closestBusinessId+getGlobalConfig().businessDimensionStart);
|
||||||
client.player.dimension = closestBusiness.exitDimension;
|
client.player.dimension = closestBusiness.exitDimension;
|
||||||
setEntityData(client, "ag.inBusiness", closestBusinessId);
|
setEntityData(client, "ag.inBusiness", closestBusinessId);
|
||||||
return true;
|
return true;
|
||||||
@@ -162,7 +162,7 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
let closestHouseId = getClosestHouseEntrance(getPlayerPosition(client));
|
let closestHouseId = getClosestHouseEntrance(getPlayerPosition(client));
|
||||||
let closestHouse = getHouseData(closestHouseId);
|
let closestHouse = getHouseData(closestHouseId);
|
||||||
//let distance = getDistance(closestHouse.entrancePosition, getPlayerPosition(client));
|
//let distance = getDistance(closestHouse.entrancePosition, getPlayerPosition(client));
|
||||||
if(getDistance(closestHouse.entrancePosition, getPlayerPosition(client)) <= getServerConfig().enterPropertyDistance) {
|
if(getDistance(closestHouse.entrancePosition, getPlayerPosition(client)) <= getGlobalConfig().enterPropertyDistance) {
|
||||||
if(!doesHouseHaveInterior(closestHouseId)) {
|
if(!doesHouseHaveInterior(closestHouseId)) {
|
||||||
messageClientAlert(client, "This house does not have an interior.");
|
messageClientAlert(client, "This house does not have an interior.");
|
||||||
messageClientTip(client, "You can use house commands at the door.");
|
messageClientTip(client, "You can use house commands at the door.");
|
||||||
@@ -175,7 +175,7 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
meActionToNearbyPlayers(client, "opens the door and enters the house");
|
meActionToNearbyPlayers(client, "opens the door and enters the house");
|
||||||
triggerNetworkEvent("ag.enterProperty", client, closestHouse.exitPosition, closestHouse.exitRotation, closestHouse.exitInterior, closestHouse+getServerConfig().houseDimensionStart);
|
triggerNetworkEvent("ag.enterProperty", client, closestHouse.exitPosition, closestHouse.exitRotation, closestHouse.exitInterior, closestHouse+getGlobalConfig().houseDimensionStart);
|
||||||
//client.player.dimension = closestHouse.exitDimension;
|
//client.player.dimension = closestHouse.exitDimension;
|
||||||
setEntityData(client, "ag.inHouse", closestHouseId);
|
setEntityData(client, "ag.inHouse", closestHouseId);
|
||||||
return true;
|
return true;
|
||||||
@@ -190,9 +190,9 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function sendRemovedWorldObjectsToPlayer(client) {
|
function sendRemovedWorldObjectsToPlayer(client) {
|
||||||
for(let i in getServerConfig().removedWorldObjects[getServerGame()]) {
|
for(let i in getGameConfig().removedWorldObjects[getServerGame()]) {
|
||||||
console.log(`[Asshat.Misc] Sending removed world object ${i} (${getServerConfig().removedWorldObjects[getServerGame()][i].model}) to ${client.name}`);
|
console.log(`[Asshat.Misc] Sending removed world object ${i} (${getGameConfig().removedWorldObjects[getServerGame()][i].model}) to ${client.name}`);
|
||||||
triggerNetworkEvent("ag.removeWorldObject", client, getServerConfig().removedWorldObjects[getServerGame()][i].model, getServerConfig().removedWorldObjects[getServerGame()][i].position, getServerConfig().removedWorldObjects[getServerGame()][i].range);
|
triggerNetworkEvent("ag.removeWorldObject", client, getGameConfig().removedWorldObjects[getServerGame()][i].model, getGameConfig().removedWorldObjects[getServerGame()][i].position, getGameConfig().removedWorldObjects[getServerGame()][i].range);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1192,9 +1192,9 @@ function createAllLocationBlips() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function createAllPoliceStationBlips() {
|
function createAllPoliceStationBlips() {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].policeStation != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].policeStation != -1) {
|
||||||
for(let i in getServerData().policeStations[getServerGame()]) {
|
for(let i in getServerData().policeStations[getServerGame()]) {
|
||||||
getServerData().policeStations[getServerGame()][i].blip = createBlip(getServerConfig().blipSprites[getServerGame()].policeStation, getServerData().policeStations[getServerGame()][i].position);
|
getServerData().policeStations[getServerGame()][i].blip = createBlip(getGameConfig().blipSprites[getServerGame()].policeStation, getServerData().policeStations[getServerGame()][i].position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1202,9 +1202,9 @@ function createAllPoliceStationBlips() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function createAllFireStationBlips() {
|
function createAllFireStationBlips() {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].fireStation != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].fireStation != -1) {
|
||||||
for(let i in getServerData().fireStations[getServerGame()]) {
|
for(let i in getServerData().fireStations[getServerGame()]) {
|
||||||
getServerData().fireStations[getServerGame()][i].blip = createBlip(getServerConfig().blipSprites[getServerGame()].fireStation, getServerData().fireStations[getServerGame()][i].position);
|
getServerData().fireStations[getServerGame()][i].blip = createBlip(getGameConfig().blipSprites[getServerGame()].fireStation, getServerData().fireStations[getServerGame()][i].position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1212,9 +1212,9 @@ function createAllFireStationBlips() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function createAllHospitalBlips() {
|
function createAllHospitalBlips() {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].hospital != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].hospital != -1) {
|
||||||
for(let i in getServerData().hospitals[getServerGame()]) {
|
for(let i in getServerData().hospitals[getServerGame()]) {
|
||||||
getServerData().hospitals[getServerGame()][i].blip = createBlip(getServerConfig().blipSprites[getServerGame()].hospital, getServerData().hospitals[getServerGame()][i].position);
|
getServerData().hospitals[getServerGame()][i].blip = createBlip(getGameConfig().blipSprites[getServerGame()].hospital, getServerData().hospitals[getServerGame()][i].position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1222,9 +1222,9 @@ function createAllHospitalBlips() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function createAllAmmunationBlips() {
|
function createAllAmmunationBlips() {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].ammunation != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].ammunation != -1) {
|
||||||
for(let i in getServerData().ammunations[getServerGame()]) {
|
for(let i in getServerData().ammunations[getServerGame()]) {
|
||||||
getServerData().ammunations[getServerGame()][i].blip = createBlip(getServerConfig().blipSprites[getServerGame()].ammunation, getServerData().ammunations[getServerGame()][i].position);
|
getServerData().ammunations[getServerGame()][i].blip = createBlip(getGameConfig().blipSprites[getServerGame()].ammunation, getServerData().ammunations[getServerGame()][i].position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1232,9 +1232,9 @@ function createAllAmmunationBlips() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function createAllPayAndSprayBlips() {
|
function createAllPayAndSprayBlips() {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].payAndSpray != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].payAndSpray != -1) {
|
||||||
for(let i in getServerData().payAndSprays[getServerGame()]) {
|
for(let i in getServerData().payAndSprays[getServerGame()]) {
|
||||||
getServerData().payAndSprays[getServerGame()][i].blip = createBlip(getServerConfig().blipSprites[getServerGame()].payAndSpray, getServerData().payAndSprays[getServerGame()][i].position);
|
getServerData().payAndSprays[getServerGame()][i].blip = createBlip(getGameConfig().blipSprites[getServerGame()].payAndSpray, getServerData().payAndSprays[getServerGame()][i].position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1242,9 +1242,9 @@ function createAllPayAndSprayBlips() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function createAllFuelStationBlips() {
|
function createAllFuelStationBlips() {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].fuelStation != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].fuelStation != -1) {
|
||||||
for(let i in getServerData().fuelStations[getServerGame()]) {
|
for(let i in getServerData().fuelStations[getServerGame()]) {
|
||||||
getServerData().fuelStations[getServerGame()][i].blip = createBlip(getServerConfig().blipSprites[getServerGame()].fuelStation, getServerData().fuelStations[getServerGame()][i].position, 2, getColourByName("burntOrange"));
|
getServerData().fuelStations[getServerGame()][i].blip = createBlip(getGameConfig().blipSprites[getServerGame()].fuelStation, getServerData().fuelStations[getServerGame()][i].position, 2, getColourByName("burntOrange"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1252,11 +1252,11 @@ function createAllFuelStationBlips() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function sendAllPoliceStationBlips(client) {
|
function sendAllPoliceStationBlips(client) {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].policeStation != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].policeStation != -1) {
|
||||||
let tempBlips = [];
|
let tempBlips = [];
|
||||||
for(let i in getServerData().policeStations[getServerGame()]) {
|
for(let i in getServerData().policeStations[getServerGame()]) {
|
||||||
tempBlips.push([
|
tempBlips.push([
|
||||||
getServerConfig().blipSprites[getServerGame()].policeStation,
|
getGameConfig().blipSprites[getServerGame()].policeStation,
|
||||||
getServerData().policeStations[getServerGame()][i].position.x,
|
getServerData().policeStations[getServerGame()][i].position.x,
|
||||||
getServerData().policeStations[getServerGame()][i].position.y,
|
getServerData().policeStations[getServerGame()][i].position.y,
|
||||||
getServerData().policeStations[getServerGame()][i].position.z,
|
getServerData().policeStations[getServerGame()][i].position.z,
|
||||||
@@ -1271,11 +1271,11 @@ function sendAllPoliceStationBlips(client) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function sendAllFireStationBlips(client) {
|
function sendAllFireStationBlips(client) {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].fireStation != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].fireStation != -1) {
|
||||||
let tempBlips = [];
|
let tempBlips = [];
|
||||||
for(let i in getServerData().fireStations[getServerGame()]) {
|
for(let i in getServerData().fireStations[getServerGame()]) {
|
||||||
tempBlips.push([
|
tempBlips.push([
|
||||||
getServerConfig().blipSprites[getServerGame()].fireStation,
|
getGameConfig().blipSprites[getServerGame()].fireStation,
|
||||||
getServerData().fireStations[getServerGame()][i].position.x,
|
getServerData().fireStations[getServerGame()][i].position.x,
|
||||||
getServerData().fireStations[getServerGame()][i].position.y,
|
getServerData().fireStations[getServerGame()][i].position.y,
|
||||||
getServerData().fireStations[getServerGame()][i].position.z,
|
getServerData().fireStations[getServerGame()][i].position.z,
|
||||||
@@ -1290,11 +1290,11 @@ function sendAllFireStationBlips(client) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function sendAllHospitalBlips(client) {
|
function sendAllHospitalBlips(client) {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].hospital != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].hospital != -1) {
|
||||||
let tempBlips = [];
|
let tempBlips = [];
|
||||||
for(let i in getServerData().hospitals[getServerGame()]) {
|
for(let i in getServerData().hospitals[getServerGame()]) {
|
||||||
tempBlips.push([
|
tempBlips.push([
|
||||||
getServerConfig().blipSprites[getServerGame()].hospital,
|
getGameConfig().blipSprites[getServerGame()].hospital,
|
||||||
getServerData().hospitals[getServerGame()][i].position.x,
|
getServerData().hospitals[getServerGame()][i].position.x,
|
||||||
getServerData().hospitals[getServerGame()][i].position.y,
|
getServerData().hospitals[getServerGame()][i].position.y,
|
||||||
getServerData().hospitals[getServerGame()][i].position.z,
|
getServerData().hospitals[getServerGame()][i].position.z,
|
||||||
@@ -1309,11 +1309,11 @@ function sendAllHospitalBlips(client) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function sendAllAmmunationBlips(client) {
|
function sendAllAmmunationBlips(client) {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].ammunation != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].ammunation != -1) {
|
||||||
let tempBlips = [];
|
let tempBlips = [];
|
||||||
for(let i in getServerData().ammunations[getServerGame()]) {
|
for(let i in getServerData().ammunations[getServerGame()]) {
|
||||||
tempBlips.push([
|
tempBlips.push([
|
||||||
getServerConfig().blipSprites[getServerGame()].ammunation,
|
getGameConfig().blipSprites[getServerGame()].ammunation,
|
||||||
getServerData().ammunations[getServerGame()][i].position.x,
|
getServerData().ammunations[getServerGame()][i].position.x,
|
||||||
getServerData().ammunations[getServerGame()][i].position.y,
|
getServerData().ammunations[getServerGame()][i].position.y,
|
||||||
getServerData().ammunations[getServerGame()][i].position.z,
|
getServerData().ammunations[getServerGame()][i].position.z,
|
||||||
@@ -1328,11 +1328,11 @@ function sendAllAmmunationBlips(client) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function sendAllPayAndSprayBlips(client) {
|
function sendAllPayAndSprayBlips(client) {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].payAndSpray != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].payAndSpray != -1) {
|
||||||
let tempBlips = [];
|
let tempBlips = [];
|
||||||
for(let i in getServerData().payAndSprays[getServerGame()]) {
|
for(let i in getServerData().payAndSprays[getServerGame()]) {
|
||||||
tempBlips.push([
|
tempBlips.push([
|
||||||
getServerConfig().blipSprites[getServerGame()].payAndSpray,
|
getGameConfig().blipSprites[getServerGame()].payAndSpray,
|
||||||
getServerData().payAndSprays[getServerGame()][i].position.x,
|
getServerData().payAndSprays[getServerGame()][i].position.x,
|
||||||
getServerData().payAndSprays[getServerGame()][i].position.y,
|
getServerData().payAndSprays[getServerGame()][i].position.y,
|
||||||
getServerData().payAndSprays[getServerGame()][i].position.z,
|
getServerData().payAndSprays[getServerGame()][i].position.z,
|
||||||
@@ -1347,11 +1347,11 @@ function sendAllPayAndSprayBlips(client) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function sendAllFuelStationBlips(client) {
|
function sendAllFuelStationBlips(client) {
|
||||||
if(getServerConfig().blipSprites[getServerGame()].fuelStation != -1) {
|
if(getGameConfig().blipSprites[getServerGame()].fuelStation != -1) {
|
||||||
let tempBlips = [];
|
let tempBlips = [];
|
||||||
for(let i in getServerData().fuelStations[getServerGame()]) {
|
for(let i in getServerData().fuelStations[getServerGame()]) {
|
||||||
tempBlips.push([
|
tempBlips.push([
|
||||||
getServerConfig().blipSprites[getServerGame()].fuelStation,
|
getGameConfig().blipSprites[getServerGame()].fuelStation,
|
||||||
getServerData().fuelStations[getServerGame()][i].position.x,
|
getServerData().fuelStations[getServerGame()][i].position.x,
|
||||||
getServerData().fuelStations[getServerGame()][i].position.y,
|
getServerData().fuelStations[getServerGame()][i].position.y,
|
||||||
getServerData().fuelStations[getServerGame()][i].position.z,
|
getServerData().fuelStations[getServerGame()][i].position.z,
|
||||||
@@ -1460,13 +1460,13 @@ function processHoldActionKey(client) {
|
|||||||
|
|
||||||
|
|
||||||
if(getClientCurrentSubAccount(client).job == AG_JOB_NONE) {
|
if(getClientCurrentSubAccount(client).job == AG_JOB_NONE) {
|
||||||
if(jobData.position.distance(client.player.position) <= getServerConfig().takeJobDistance) {
|
if(jobData.position.distance(client.player.position) <= getGlobalConfig().takeJobDistance) {
|
||||||
takeJob(client, closestJobId);
|
takeJob(client, closestJobId);
|
||||||
messageClientSuccess(client, "You now have the " + toString(jobData.name) + " job");
|
messageClientSuccess(client, "You now have the " + toString(jobData.name) + " job");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(jobData.jobType == getClientCurrentSubAccount(client).job) {
|
if(jobData.jobType == getClientCurrentSubAccount(client).job) {
|
||||||
if(jobData.position.distance(client.player.position) <= getServerConfig().startWorkDistance) {
|
if(jobData.position.distance(client.player.position) <= getGlobalConfig().startWorkDistance) {
|
||||||
startWorking(client);
|
startWorking(client);
|
||||||
messageClientSuccess(client, "You are now working as a " + toString(jobData.name));
|
messageClientSuccess(client, "You are now working as a " + toString(jobData.name));
|
||||||
showStartedWorkingTip(client);
|
showStartedWorkingTip(client);
|
||||||
@@ -1486,7 +1486,7 @@ function processPressActionKey(client) {
|
|||||||
let closestJob = getClosestJob(client.player.position);
|
let closestJob = getClosestJob(client.player.position);
|
||||||
|
|
||||||
if(getClientCurrentSubAccount(client).job == AG_JOB_NONE) {
|
if(getClientCurrentSubAccount(client).job == AG_JOB_NONE) {
|
||||||
if(closestJob.position.distance(client.player.position) <= getServerConfig().takeJobDistance) {
|
if(closestJob.position.distance(client.player.position) <= getGlobalConfig().takeJobDistance) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1568,18 +1568,35 @@ function updateServerRules() {
|
|||||||
function getWeatherFromParams(params) {
|
function getWeatherFromParams(params) {
|
||||||
if(isNaN(params)) {
|
if(isNaN(params)) {
|
||||||
for(let i in getGameData().weatherNames[getServerGame()]) {
|
for(let i in getGameData().weatherNames[getServerGame()]) {
|
||||||
if(toLowerCase(weatherNames[getServerGame()][i]).indexOf(toLowerCase(params)) != -1) {
|
if(toLowerCase(getGameData().weatherNames[getServerGame()][i]).indexOf(toLowerCase(params)) != -1) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
if(typeof getGameData().weatherNames[getServerGame()][params] != "undefined") {
|
||||||
|
return toInteger(params);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function getClanFromParams(params) {
|
||||||
|
if(isNaN(params)) {
|
||||||
|
for(let i in getServerData().clans) {
|
||||||
|
if(toLowerCase(getServerData().clans[i].name).indexOf(toLowerCase(params)) != -1) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if(typeof getGameData().weatherNames[getServerGame()][params] != "undefined") {
|
if(typeof getServerData().clans[params] != "undefined") {
|
||||||
return params;
|
return toInteger(params);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -1714,4 +1731,10 @@ function getLockedUnlockedFromBool(boolVal) {
|
|||||||
return (boolVal) ? "locked" : "unlocked";
|
return (boolVal) ? "locked" : "unlocked";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function getLockedUnlockedEmojiFromBool(boolVal) {
|
||||||
|
return (boolVal) ? "🔒" : "🔓";
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -136,7 +136,7 @@ function createVehicleCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let frontPos = getPosInFrontOfPos(getPlayerPosition(client), getPlayerHeading(client), getServerConfig().spawnCarDistance);
|
let frontPos = getPosInFrontOfPos(getPlayerPosition(client), getPlayerHeading(client), getGlobalConfig().spawnCarDistance);
|
||||||
let vehicleDataSlot = getServerData().vehicles.length;
|
let vehicleDataSlot = getServerData().vehicles.length;
|
||||||
|
|
||||||
let vehicle = gta.createVehicle(modelId, frontPos, getPlayerHeading(client));
|
let vehicle = gta.createVehicle(modelId, frontPos, getPlayerHeading(client));
|
||||||
@@ -167,7 +167,7 @@ function createTemporaryVehicleCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let frontPos = getPosInFrontOfPos(getPlayerPosition(client), getPlayerHeading(client), getServerConfig().spawnCarDistance);
|
let frontPos = getPosInFrontOfPos(getPlayerPosition(client), getPlayerHeading(client), getGlobalConfig().spawnCarDistance);
|
||||||
let vehicleDataSlot = getServerData().vehicles.length;
|
let vehicleDataSlot = getServerData().vehicles.length;
|
||||||
|
|
||||||
let vehicle = gta.createVehicle(modelId, frontPos, getPlayerHeading(client));
|
let vehicle = gta.createVehicle(modelId, frontPos, getPlayerHeading(client));
|
||||||
@@ -194,7 +194,7 @@ function createTemporaryVehicleCommand(command, params, client) {
|
|||||||
function vehicleLockCommand(command, params, client) {
|
function vehicleLockCommand(command, params, client) {
|
||||||
let vehicle = getClosestVehicle(getPlayerPosition(client));
|
let vehicle = getClosestVehicle(getPlayerPosition(client));
|
||||||
|
|
||||||
if(!getPlayerVehicle(client) && getDistance(getVehiclePosition(vehicle), getPlayerPosition(client)) > getServerConfig().vehicleLockDistance) {
|
if(!getPlayerVehicle(client) && getDistance(getVehiclePosition(vehicle), getPlayerPosition(client)) > getGlobalConfig().vehicleLockDistance) {
|
||||||
messageClientError(client, "You need to be in or near a vehicle!");
|
messageClientError(client, "You need to be in or near a vehicle!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -335,8 +335,8 @@ function setVehicleColourCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getClientCurrentSubAccount(client).cash < getServerConfig().resprayVehicleCost) {
|
if(getClientCurrentSubAccount(client).cash < getGlobalConfig().resprayVehicleCost) {
|
||||||
messageClientError(client, `You don't have enough money to respray the vehicle (need $${getServerConfig().resprayVehicleCost-getClientCurrentSubAccount(client).cash} more!)`);
|
messageClientError(client, `You don't have enough money to respray the vehicle (need $${getGlobalConfig().resprayVehicleCost-getClientCurrentSubAccount(client).cash} more!)`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,7 +344,7 @@ function setVehicleColourCommand(command, params, client) {
|
|||||||
let colour1 = toInteger(splitParams[0]) || 0;
|
let colour1 = toInteger(splitParams[0]) || 0;
|
||||||
let colour2 = toInteger(splitParams[1]) || 0;
|
let colour2 = toInteger(splitParams[1]) || 0;
|
||||||
|
|
||||||
getClientCurrentSubAccount(client).cash -= getServerConfig().resprayVehicleCost;
|
getClientCurrentSubAccount(client).cash -= getGlobalConfig().resprayVehicleCost;
|
||||||
vehicle.colour1 = colour1;
|
vehicle.colour1 = colour1;
|
||||||
vehicle.colour2 = colour2;
|
vehicle.colour2 = colour2;
|
||||||
getVehicleData(vehicle).colour1 = colour1;
|
getVehicleData(vehicle).colour1 = colour1;
|
||||||
@@ -370,13 +370,13 @@ function vehicleRepairCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getClientCurrentSubAccount(client).cash < getServerConfig().repairVehicleCost) {
|
if(getClientCurrentSubAccount(client).cash < getGlobalConfig().repairVehicleCost) {
|
||||||
messageClientError(client, `You don't have enough money to repair the vehicle (need $${getServerConfig().resprayVehicleCost-getClientCurrentSubAccount(client).cash} more!)`);
|
messageClientError(client, `You don't have enough money to repair the vehicle (need $${getGlobalConfig().resprayVehicleCost-getClientCurrentSubAccount(client).cash} more!)`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getClientCurrentSubAccount(client).cash -= getServerConfig().repairVehicleCost;
|
getClientCurrentSubAccount(client).cash -= getGlobalConfig().repairVehicleCost;
|
||||||
repairVehicle(vehicle);
|
repairVehicle(vehicle);
|
||||||
|
|
||||||
meActionToNearbyPlayers(client, `repairs the ${getVehicleName(vehicle)}!`);
|
meActionToNearbyPlayers(client, `repairs the ${getVehicleName(vehicle)}!`);
|
||||||
@@ -836,7 +836,7 @@ function spawnVehicle(vehicleData) {
|
|||||||
|
|
||||||
function isVehicleAtPayAndSpray(vehicle) {
|
function isVehicleAtPayAndSpray(vehicle) {
|
||||||
for(let i in getServerData().payAndSprays[getServerGame()]) {
|
for(let i in getServerData().payAndSprays[getServerGame()]) {
|
||||||
if(getDistance(getVehiclePosition(vehicle), getServerData().payAndSprays[getServerGame()][i].position) <= getServerConfig().payAndSprayDistance) {
|
if(getDistance(getVehiclePosition(vehicle), getServerData().payAndSprays[getServerGame()][i].position) <= getGlobalConfig().payAndSprayDistance) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user