Add player blips

This commit is contained in:
Vortrex
2022-06-07 10:24:10 -05:00
parent 0e05b8de8b
commit 3298aabca3
3 changed files with 355 additions and 299 deletions

View File

@@ -91,7 +91,7 @@ class ServerConfigData {
sendAdmin: true, sendAdmin: true,
}; };
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["svr_id"]; this.databaseId = dbAssoc["svr_id"];
this.newCharacter = { this.newCharacter = {
spawnPosition: toVector3(dbAssoc["svr_newchar_pos_x"], dbAssoc["svr_newchar_pos_y"], dbAssoc["svr_newchar_pos_z"]), spawnPosition: toVector3(dbAssoc["svr_newchar_pos_x"], dbAssoc["svr_newchar_pos_y"], dbAssoc["svr_newchar_pos_z"]),
@@ -101,7 +101,7 @@ class ServerConfigData {
skin: dbAssoc["svr_newchar_skin"], skin: dbAssoc["svr_newchar_skin"],
}, },
this.connectCameraPosition = toVector3(dbAssoc["svr_connectcam_pos_x"], dbAssoc["svr_connectcam_pos_y"], dbAssoc["svr_connectcam_pos_z"]); 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.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.hour = toInteger(dbAssoc["svr_start_time_hour"]);
@@ -118,6 +118,7 @@ class ServerConfigData {
this.createJobBlips = intToBool(toInteger(dbAssoc["svr_job_blips"])); this.createJobBlips = intToBool(toInteger(dbAssoc["svr_job_blips"]));
this.createBusinessBlips = intToBool(toInteger(dbAssoc["svr_biz_blips"])); this.createBusinessBlips = intToBool(toInteger(dbAssoc["svr_biz_blips"]));
this.createHouseBlips = intToBool(toInteger(dbAssoc["svr_house_blips"])); this.createHouseBlips = intToBool(toInteger(dbAssoc["svr_house_blips"]));
this.createPlayerBlips = intToBool(toInteger(dbAssoc["svr_player_blips"]));
this.guiColourPrimary = [toInteger(dbAssoc["svr_gui_col1_r"]), toInteger(dbAssoc["svr_gui_col1_g"]), toInteger(dbAssoc["svr_gui_col1_b"])]; this.guiColourPrimary = [toInteger(dbAssoc["svr_gui_col1_r"]), toInteger(dbAssoc["svr_gui_col1_g"]), toInteger(dbAssoc["svr_gui_col1_b"])];
this.guiColourSecondary = [toInteger(dbAssoc["svr_gui_col2_r"]), toInteger(dbAssoc["svr_gui_col2_g"]), toInteger(dbAssoc["svr_gui_col2_b"])]; this.guiColourSecondary = [toInteger(dbAssoc["svr_gui_col2_r"]), toInteger(dbAssoc["svr_gui_col2_g"]), toInteger(dbAssoc["svr_gui_col2_b"])];
this.guiTextColourPrimary = [toInteger(dbAssoc["svr_gui_textcol1_r"]), toInteger(dbAssoc["svr_gui_textcol1_g"]), toInteger(dbAssoc["svr_gui_textcol1_b"])]; this.guiTextColourPrimary = [toInteger(dbAssoc["svr_gui_textcol1_r"]), toInteger(dbAssoc["svr_gui_textcol1_g"]), toInteger(dbAssoc["svr_gui_textcol1_b"])];
@@ -276,11 +277,11 @@ class AccountData {
this.staffTitle = ""; this.staffTitle = "";
this.ircAccount = ""; this.ircAccount = "";
this.discordAccount = 0, this.discordAccount = 0,
this.settings = 0, this.settings = 0,
this.emailAddress = ""; this.emailAddress = "";
this.ipAddress = 0, this.ipAddress = 0,
this.notes = []; this.notes = [];
this.messages = []; this.messages = [];
this.contacts = []; this.contacts = [];
this.subAccounts = []; this.subAccounts = [];
@@ -294,7 +295,7 @@ class AccountData {
this.streamingRadioVolume = 20; this.streamingRadioVolume = 20;
this.locale = 0; this.locale = 0;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["acct_id"]; this.databaseId = dbAssoc["acct_id"];
this.name = dbAssoc["acct_name"]; this.name = dbAssoc["acct_name"];
this.password = dbAssoc["acct_pass"]; this.password = dbAssoc["acct_pass"];
@@ -338,7 +339,7 @@ class AccountContactData {
this.whenAdded = 0; this.whenAdded = 0;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["acct_contact_id"]; this.databaseId = dbAssoc["acct_contact_id"];
this.accountId = dbAssoc["acct_contact_acct"]; this.accountId = dbAssoc["acct_contact_acct"];
this.contactAccountId = dbAssoc["acct_contact_contact"]; this.contactAccountId = dbAssoc["acct_contact_contact"];
@@ -364,7 +365,7 @@ class AccountMessageData {
this.message = ""; this.message = "";
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["acct_msg_id"]; this.databaseId = dbAssoc["acct_msg_id"];
this.account = dbAssoc["acct_msg_acct"]; this.account = dbAssoc["acct_msg_acct"];
this.whoSent = dbAssoc["acct_msg_who_sent"]; this.whoSent = dbAssoc["acct_msg_who_sent"];
@@ -393,7 +394,7 @@ class AccountStaffNoteData {
this.note = ""; this.note = "";
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["acct_note_id"]; this.databaseId = dbAssoc["acct_note_id"];
this.account = dbAssoc["acct_note_acct"]; this.account = dbAssoc["acct_note_acct"];
this.whoAdded = dbAssoc["acct_note_who_added"]; this.whoAdded = dbAssoc["acct_note_who_added"];
@@ -444,26 +445,26 @@ class SubAccountData {
this.accent = ""; this.accent = "";
this.bodyParts = { this.bodyParts = {
hair: [0,0], hair: [0, 0],
head: [0,0], head: [0, 0],
upper: [0,0], upper: [0, 0],
lower: [0,0], lower: [0, 0],
}; };
this.bodyProps = { this.bodyProps = {
hair: [0,0], hair: [0, 0],
eyes: [0,0], eyes: [0, 0],
head: [0,0], head: [0, 0],
leftHand: [0,0], leftHand: [0, 0],
rightHand: [0,0], rightHand: [0, 0],
leftWrist: [0,0], leftWrist: [0, 0],
rightWrist: [0,0], rightWrist: [0, 0],
hip: [0,0], hip: [0, 0],
leftFoot: [0,0], leftFoot: [0, 0],
rightFoot: [0,0], rightFoot: [0, 0],
}; };
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["sacct_id"]; this.databaseId = dbAssoc["sacct_id"];
this.serverId = toInteger(dbAssoc["sacct_server"]); this.serverId = toInteger(dbAssoc["sacct_server"]);
this.firstName = dbAssoc["sacct_name_first"]; this.firstName = dbAssoc["sacct_name_first"];
@@ -567,7 +568,7 @@ class BusinessData {
this.customInterior = false; this.customInterior = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["biz_id"]); this.databaseId = toInteger(dbAssoc["biz_id"]);
this.name = toString(dbAssoc["biz_name"]); this.name = toString(dbAssoc["biz_name"]);
this.ownerType = toInteger(dbAssoc["biz_owner_type"]); this.ownerType = toInteger(dbAssoc["biz_owner_type"]);
@@ -621,7 +622,7 @@ class BusinessLocationData {
this.interior = 0; this.interior = 0;
this.dimension = 0; this.dimension = 0;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["biz_loc_id"]); this.databaseId = toInteger(dbAssoc["biz_loc_id"]);
this.name = toString(dbAssoc["biz_loc_name"]); this.name = toString(dbAssoc["biz_loc_name"]);
this.type = toInteger(dbAssoc["biz_loc_type"]); this.type = toInteger(dbAssoc["biz_loc_type"]);
@@ -648,7 +649,7 @@ class BusinessGameScriptData {
this.businessIndex = -1; this.businessIndex = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["biz_script_id"]); this.databaseId = toInteger(dbAssoc["biz_script_id"]);
this.name = toString(dbAssoc["biz_script_name"]); this.name = toString(dbAssoc["biz_script_name"]);
this.state = toInteger(dbAssoc["biz_script_state"]); this.state = toInteger(dbAssoc["biz_script_state"]);
@@ -703,7 +704,7 @@ class HouseData {
this.customInterior = false; this.customInterior = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["house_id"]); this.databaseId = toInteger(dbAssoc["house_id"]);
this.description = toString(dbAssoc["house_description"]); this.description = toString(dbAssoc["house_description"]);
this.ownerType = toInteger(dbAssoc["house_owner_type"]); this.ownerType = toInteger(dbAssoc["house_owner_type"]);
@@ -754,7 +755,7 @@ class HouseLocationData {
this.interior = 0; this.interior = 0;
this.dimension = 0; this.dimension = 0;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["house_loc_id"]); this.databaseId = toInteger(dbAssoc["house_loc_id"]);
this.name = toString(dbAssoc["house_loc_name"]); this.name = toString(dbAssoc["house_loc_name"]);
this.type = toInteger(dbAssoc["house_loc_type"]); this.type = toInteger(dbAssoc["house_loc_type"]);
@@ -786,7 +787,7 @@ class HouseGameScriptData {
this.houseIndex = -1; this.houseIndex = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["house_script_id"]); this.databaseId = toInteger(dbAssoc["house_script_id"]);
this.name = toString(dbAssoc["house_script_name"]); this.name = toString(dbAssoc["house_script_name"]);
this.state = toInteger(dbAssoc["house_script_state"]); this.state = toInteger(dbAssoc["house_script_state"]);
@@ -814,7 +815,7 @@ class ClanData {
this.needsSaved = false; this.needsSaved = false;
this.motd = false; this.motd = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["clan_id"]); this.databaseId = toInteger(dbAssoc["clan_id"]);
this.name = dbAssoc["clan_name"]; this.name = dbAssoc["clan_name"];
this.owner = toInteger(dbAssoc["clan_owner"]); this.owner = toInteger(dbAssoc["clan_owner"]);
@@ -843,7 +844,7 @@ class ClanRankData {
this.clanIndex = -1; this.clanIndex = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["clan_rank_id"]); this.databaseId = toInteger(dbAssoc["clan_rank_id"]);
this.clan = toInteger(dbAssoc["clan_rank_clan"]); this.clan = toInteger(dbAssoc["clan_rank_clan"]);
this.name = dbAssoc["clan_rank_name"]; this.name = dbAssoc["clan_rank_name"];
@@ -873,7 +874,7 @@ class ClanMemberData {
this.rankIndex = -1; this.rankIndex = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["clan_member_id"]); this.databaseId = toInteger(dbAssoc["clan_member_id"]);
this.subAccount = toInteger(dbAssoc["clan_member_sacct"]); this.subAccount = toInteger(dbAssoc["clan_member_sacct"]);
this.clan = toInteger(dbAssoc["clan_member_clan"]); this.clan = toInteger(dbAssoc["clan_member_clan"]);
@@ -960,7 +961,7 @@ class VehicleData {
this.triggers = []; this.triggers = [];
if(dbAssoc) { if (dbAssoc) {
// General Info // General Info
this.databaseId = toInteger(dbAssoc["veh_id"]); this.databaseId = toInteger(dbAssoc["veh_id"]);
this.serverId = toInteger(dbAssoc["veh_server"]); this.serverId = toInteger(dbAssoc["veh_server"]);
@@ -1081,7 +1082,7 @@ class JobData {
this.blackList = []; this.blackList = [];
this.routes = []; this.routes = [];
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_id"]; this.databaseId = dbAssoc["job_id"];
this.serverId = dbAssoc["job_server"]; this.serverId = dbAssoc["job_server"];
this.type = dbAssoc["job_type"]; this.type = dbAssoc["job_type"];
@@ -1119,7 +1120,7 @@ class JobEquipmentData {
this.needsSaved = false; this.needsSaved = false;
this.items = []; this.items = [];
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_equip_id"]; this.databaseId = dbAssoc["job_equip_id"];
this.job = dbAssoc["job_equip_job"]; this.job = dbAssoc["job_equip_job"];
this.name = dbAssoc["job_equip_name"]; this.name = dbAssoc["job_equip_name"];
@@ -1143,7 +1144,7 @@ class JobEquipmentItemData {
this.jobIndex = -1; this.jobIndex = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_equip_item_id"]; this.databaseId = dbAssoc["job_equip_item_id"];
this.equipmentId = dbAssoc["job_equip_item_equip"]; this.equipmentId = dbAssoc["job_equip_item_equip"];
this.itemType = dbAssoc["job_equip_item_type"]; this.itemType = dbAssoc["job_equip_item_type"];
@@ -1169,26 +1170,26 @@ class JobUniformData {
this.needsSaved = false; this.needsSaved = false;
this.bodyParts = { this.bodyParts = {
hair: [0,0], hair: [0, 0],
head: [0,0], head: [0, 0],
upper: [0,0], upper: [0, 0],
lower: [0,0], lower: [0, 0],
}; };
this.bodyProps = { this.bodyProps = {
hair: [0,0], hair: [0, 0],
eyes: [0,0], eyes: [0, 0],
head: [0,0], head: [0, 0],
leftHand: [0,0], leftHand: [0, 0],
rightHand: [0,0], rightHand: [0, 0],
leftWrist: [0,0], leftWrist: [0, 0],
rightWrist: [0,0], rightWrist: [0, 0],
hip: [0,0], hip: [0, 0],
leftFoot: [0,0], leftFoot: [0, 0],
rightFoot: [0,0], rightFoot: [0, 0],
}; };
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_uniform_id"]; this.databaseId = dbAssoc["job_uniform_id"];
this.job = dbAssoc["job_uniform_job"]; this.job = dbAssoc["job_uniform_job"];
this.name = dbAssoc["job_uniform_name"]; this.name = dbAssoc["job_uniform_name"];
@@ -1237,7 +1238,7 @@ class JobLocationData {
this.needsSaved = false; this.needsSaved = false;
this.routeCache = []; this.routeCache = [];
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["job_loc_id"]); this.databaseId = toInteger(dbAssoc["job_loc_id"]);
this.jobId = toInteger(dbAssoc["job_loc_job"]); this.jobId = toInteger(dbAssoc["job_loc_job"]);
this.position = toVector3(toFloat(dbAssoc["job_loc_pos_x"]), toFloat(dbAssoc["job_loc_pos_y"]), toFloat(dbAssoc["job_loc_pos_z"])); this.position = toVector3(toFloat(dbAssoc["job_loc_pos_x"]), toFloat(dbAssoc["job_loc_pos_y"]), toFloat(dbAssoc["job_loc_pos_z"]));
@@ -1258,7 +1259,7 @@ class JobWhiteListData {
this.jobIndex = -1; this.jobIndex = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_wl_id"]; this.databaseId = dbAssoc["job_wl_id"];
this.job = dbAssoc["job_wl_job"]; this.job = dbAssoc["job_wl_job"];
this.subAccount = dbAssoc["job_wl_sacct"] this.subAccount = dbAssoc["job_wl_sacct"]
@@ -1277,7 +1278,7 @@ class JobBlackListData {
this.jobIndex = -1; this.jobIndex = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_bl_id"]; this.databaseId = dbAssoc["job_bl_id"];
this.job = dbAssoc["job_bl_job"]; this.job = dbAssoc["job_bl_job"];
this.subAccount = dbAssoc["job_bl_sacct"] this.subAccount = dbAssoc["job_bl_sacct"]
@@ -1298,7 +1299,7 @@ class KeyBindData {
this.index = -1; this.index = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["acct_hotkey_id"]; this.databaseId = dbAssoc["acct_hotkey_id"];
this.key = toInteger(dbAssoc["acct_hotkey_key"]); this.key = toInteger(dbAssoc["acct_hotkey_key"]);
this.account = toInteger(dbAssoc["acct_hotkey_acct"]); this.account = toInteger(dbAssoc["acct_hotkey_acct"]);
@@ -1319,7 +1320,7 @@ class RadioStationData {
this.codec = ""; this.codec = "";
this.index = -1; this.index = -1;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["radio_id"]; this.databaseId = dbAssoc["radio_id"];
this.name = dbAssoc["radio_name"]; this.name = dbAssoc["radio_name"];
this.url = dbAssoc["radio_url"]; this.url = dbAssoc["radio_url"];
@@ -1349,7 +1350,7 @@ class ItemData {
this.enabled = false; this.enabled = false;
this.extra = false; this.extra = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["item_id"]); this.databaseId = toInteger(dbAssoc["item_id"]);
this.index = 0; this.index = 0;
this.itemTypeIndex = 0; this.itemTypeIndex = 0;
@@ -1412,7 +1413,7 @@ class ItemTypeData {
this.takeAnimationIndex = false; this.takeAnimationIndex = false;
this.switchAnimationIndex = false; this.switchAnimationIndex = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["item_type_id"]); this.databaseId = toInteger(dbAssoc["item_type_id"]);
this.serverId = toInteger(dbAssoc["item_type_server"]); this.serverId = toInteger(dbAssoc["item_type_server"]);
this.name = dbAssoc["item_type_name"]; this.name = dbAssoc["item_type_name"];
@@ -1486,28 +1487,28 @@ class NPCData {
this.ownerId = 0; this.ownerId = 0;
this.bodyParts = { this.bodyParts = {
hair: [0,0], hair: [0, 0],
head: [0,0], head: [0, 0],
upper: [0,0], upper: [0, 0],
lower: [0,0], lower: [0, 0],
}; };
this.bodyProps = { this.bodyProps = {
hair: [0,0], hair: [0, 0],
eyes: [0,0], eyes: [0, 0],
head: [0,0], head: [0, 0],
leftHand: [0,0], leftHand: [0, 0],
rightHand: [0,0], rightHand: [0, 0],
leftWrist: [0,0], leftWrist: [0, 0],
rightWrist: [0,0], rightWrist: [0, 0],
hip: [0,0], hip: [0, 0],
leftFoot: [0,0], leftFoot: [0, 0],
rightFoot: [0,0], rightFoot: [0, 0],
}; };
this.triggers = []; this.triggers = [];
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["npc_id"]); this.databaseId = toInteger(dbAssoc["npc_id"]);
this.serverId = toInteger(dbAssoc["npc_server"]); this.serverId = toInteger(dbAssoc["npc_server"]);
this.name = dbAssoc["npc_name"]; this.name = dbAssoc["npc_name"];
@@ -1567,7 +1568,7 @@ class NPCTriggerData {
this.conditions = []; this.conditions = [];
this.responses = []; this.responses = [];
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["npc_trig_id"]); this.databaseId = toInteger(dbAssoc["npc_trig_id"]);
this.npc = toInteger(dbAssoc["npc_trig_npc"]); this.npc = toInteger(dbAssoc["npc_trig_npc"]);
this.triggerType = toInteger(dbAssoc["npc_trig_type"]); this.triggerType = toInteger(dbAssoc["npc_trig_type"]);
@@ -1585,7 +1586,7 @@ class NPCTriggerConditionData {
this.conditionValue = false; this.conditionValue = false;
this.matchType = false; this.matchType = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["npc_trig_cond_id"]); this.databaseId = toInteger(dbAssoc["npc_trig_cond_id"]);
this.npc = toInteger(dbAssoc["npc_trig_cond_trig"]); this.npc = toInteger(dbAssoc["npc_trig_cond_trig"]);
this.conditionType = toInteger(dbAssoc["npc_trig_cond_type"]); this.conditionType = toInteger(dbAssoc["npc_trig_cond_type"]);
@@ -1604,7 +1605,7 @@ class NPCTriggerResponseData {
this.responseType = 0; this.responseType = 0;
this.responseValue = false; this.responseValue = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["npc_trig_resp_id"]); this.databaseId = toInteger(dbAssoc["npc_trig_resp_id"]);
this.npc = toInteger(dbAssoc["npc_trig_resp_trig"]); this.npc = toInteger(dbAssoc["npc_trig_resp_trig"]);
this.responseType = toInteger(dbAssoc["npc_trig_resp_type"]); this.responseType = toInteger(dbAssoc["npc_trig_resp_type"]);
@@ -1622,7 +1623,7 @@ class BanData {
this.name = ""; this.name = "";
this.reason = ""; this.reason = "";
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["ban_id"]); this.databaseId = toInteger(dbAssoc["ban_id"]);
this.type = dbAssoc["ban_type"]; this.type = dbAssoc["ban_type"];
this.detail = toInteger(dbAssoc["ban_detail"]); this.detail = toInteger(dbAssoc["ban_detail"]);
@@ -1653,7 +1654,7 @@ class JobRouteData {
this.locationNextMessage = ""; this.locationNextMessage = "";
this.locations = []; this.locations = [];
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["job_route_id"]); this.databaseId = toInteger(dbAssoc["job_route_id"]);
this.name = toString(dbAssoc["job_route_name"]); this.name = toString(dbAssoc["job_route_name"]);
this.jobId = toInteger(dbAssoc["job_route_job"]); this.jobId = toInteger(dbAssoc["job_route_job"]);
@@ -1685,7 +1686,7 @@ class JobRouteLocationData {
this.stopDelay = 0; this.stopDelay = 0;
this.pay = 0; this.pay = 0;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["job_route_loc_id"]); this.databaseId = toInteger(dbAssoc["job_route_loc_id"]);
this.name = toString(dbAssoc["job_route_loc_name"]); this.name = toString(dbAssoc["job_route_loc_name"]);
this.routeId = toInteger(dbAssoc["job_route_loc_route"]); this.routeId = toInteger(dbAssoc["job_route_loc_route"]);
@@ -1708,7 +1709,7 @@ class GateData {
this.ownerType = VRR_GATEOWNER_NONE; this.ownerType = VRR_GATEOWNER_NONE;
this.ownerId = 0; this.ownerId = 0;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["gate_id"]); this.databaseId = toInteger(dbAssoc["gate_id"]);
this.name = toString(dbAssoc["gate_name"]); this.name = toString(dbAssoc["gate_name"]);
this.scriptName = toString(dbAssoc["gate_script_name"]); this.scriptName = toString(dbAssoc["gate_script_name"]);

View File

@@ -35,7 +35,7 @@ function toggleMouseCursorCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function toggleMouseCameraCommand(command, params, client) { function toggleMouseCameraCommand(command, params, client) {
if(getGame() != VRR_GAME_GTA_VC) { if (getGame() != VRR_GAME_GTA_VC) {
sendPlayerMouseCameraToggle(client); sendPlayerMouseCameraToggle(client);
} }
return true; return true;
@@ -58,12 +58,12 @@ function setNewCharacterSpawnPositionCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function setNewCharacterMoneyCommand(command, params, client) { function setNewCharacterMoneyCommand(command, params, client) {
if(areParamsEmpty(params)) { if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command)); messagePlayerSyntax(client, getCommandSyntaxText(command));
return false; return false;
} }
let amount = toInteger(getParam(params, " ", 1)) || 1000; let amount = toInteger(getParam(params, " ", 1)) || 1000;
getServerConfig().newCharacter.cash = amount; getServerConfig().newCharacter.cash = amount;
getServerConfig().needsSaved = true; getServerConfig().needsSaved = true;
@@ -75,7 +75,7 @@ let amount = toInteger(getParam(params, " ", 1)) || 1000;
// =========================================================================== // ===========================================================================
function setNewCharacterSkinCommand(command, params, client) { function setNewCharacterSkinCommand(command, params, client) {
if(areParamsEmpty(params)) { if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command)); messagePlayerSyntax(client, getCommandSyntaxText(command));
return false; return false;
} }
@@ -92,7 +92,7 @@ function setNewCharacterSkinCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function submitIdeaCommand(command, params, client) { function submitIdeaCommand(command, params, client) {
if(areParamsEmpty(params)) { if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command)); messagePlayerSyntax(client, getCommandSyntaxText(command));
return false; return false;
} }
@@ -106,7 +106,7 @@ function submitIdeaCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function submitBugReportCommand(command, params, client) { function submitBugReportCommand(command, params, client) {
if(areParamsEmpty(params)) { if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command)); messagePlayerSyntax(client, getCommandSyntaxText(command));
return false; return false;
} }
@@ -124,15 +124,15 @@ function enterExitPropertyCommand(command, params, client) {
let isEntrance = false; let isEntrance = false;
let isBusiness = false; let isBusiness = false;
if(areServerElementsSupported()) { if (areServerElementsSupported()) {
if(!getPlayerData(client).currentPickup) { if (!getPlayerData(client).currentPickup) {
return false; return false;
} }
let ownerType = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.type"); let ownerType = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.type");
let ownerId = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.id"); let ownerId = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.id");
switch(ownerType) { switch (ownerType) {
case VRR_PICKUP_BUSINESS_ENTRANCE: case VRR_PICKUP_BUSINESS_ENTRANCE:
isBusiness = true; isBusiness = true;
isEntrance = true; isEntrance = true;
@@ -161,8 +161,8 @@ function enterExitPropertyCommand(command, params, client) {
return false; return false;
} }
} else { } else {
for(let i in getServerData().businesses) { for (let i in getServerData().businesses) {
if(getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()] && getPlayerInterior(client) == getGameConfig().mainWorldInterior[getGame()]) { if (getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()] && getPlayerInterior(client) == getGameConfig().mainWorldInterior[getGame()]) {
let businessId = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client)); let businessId = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
isBusiness = true; isBusiness = true;
isEntrance = true; isEntrance = true;
@@ -175,8 +175,8 @@ function enterExitPropertyCommand(command, params, client) {
} }
} }
for(let j in getServerData().houses) { for (let j in getServerData().houses) {
if(getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()] && getPlayerInterior(client) == getGameConfig().mainWorldInterior[getGame()]) { if (getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()] && getPlayerInterior(client) == getGameConfig().mainWorldInterior[getGame()]) {
let houseId = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client)); let houseId = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client));
isBusiness = false; isBusiness = false;
isEntrance = true; isEntrance = true;
@@ -190,20 +190,20 @@ function enterExitPropertyCommand(command, params, client) {
} }
} }
if(closestProperty == null) { if (closestProperty == null) {
return false; return false;
} }
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s closest door is ${(isBusiness) ? closestProperty.name : closestProperty.description} ${(isEntrance) ? "entrance" : "exit"}`); logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s closest door is ${(isBusiness) ? closestProperty.name : closestProperty.description} ${(isEntrance) ? "entrance" : "exit"}`);
if(isEntrance) { if (isEntrance) {
if(getDistance(closestProperty.entrancePosition, getPlayerPosition(client)) <= getGlobalConfig().enterPropertyDistance) { if (getDistance(closestProperty.entrancePosition, getPlayerPosition(client)) <= getGlobalConfig().enterPropertyDistance) {
if(closestProperty.locked) { if (closestProperty.locked) {
meActionToNearbyPlayers(client, getLocaleString(client, "EnterExitPropertyDoorLocked", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House"))); meActionToNearbyPlayers(client, getLocaleString(client, "EnterExitPropertyDoorLocked", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House")));
return false; return false;
} }
if(!closestProperty.hasInterior) { if (!closestProperty.hasInterior) {
messagePlayerAlert(client, getLocaleString(client, "PropertyNoInterior", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House"))); messagePlayerAlert(client, getLocaleString(client, "PropertyNoInterior", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House")));
return false; return false;
} }
@@ -212,18 +212,18 @@ function enterExitPropertyCommand(command, params, client) {
getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGPROPERTY; getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGPROPERTY;
meActionToNearbyPlayers(client, getLocaleString(client, "EntersProperty", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House"))); meActionToNearbyPlayers(client, getLocaleString(client, "EntersProperty", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House")));
if(isFadeCameraSupported()) { if (isFadeCameraSupported()) {
fadeCamera(client, false, 1.0); fadeCamera(client, false, 1.0);
} }
setTimeout(function() { setTimeout(function () {
setPlayerInCutsceneInterior(client, closestProperty.exitCutscene); setPlayerInCutsceneInterior(client, closestProperty.exitCutscene);
setPlayerPosition(client, closestProperty.exitPosition); setPlayerPosition(client, closestProperty.exitPosition);
setPlayerHeading(client, closestProperty.exitRotation); setPlayerHeading(client, closestProperty.exitRotation);
setPlayerDimension(client, closestProperty.exitDimension); setPlayerDimension(client, closestProperty.exitDimension);
setPlayerInterior(client, closestProperty.exitInterior); setPlayerInterior(client, closestProperty.exitInterior);
setTimeout(function() { setTimeout(function () {
if(isFadeCameraSupported()) { if (isFadeCameraSupported()) {
fadeCamera(client, true, 1.0); fadeCamera(client, true, 1.0);
} }
updateInteriorLightsForPlayer(client, closestProperty.interiorLights); updateInteriorLightsForPlayer(client, closestProperty.interiorLights);
@@ -231,8 +231,8 @@ function enterExitPropertyCommand(command, params, client) {
//setPlayerInCutsceneInterior(client, closestProperty.exitCutscene); //setPlayerInCutsceneInterior(client, closestProperty.exitCutscene);
//updateAllInteriorVehiclesForPlayer(client, closestProperty.exitInterior, closestProperty.exitDimension); //updateAllInteriorVehiclesForPlayer(client, closestProperty.exitInterior, closestProperty.exitDimension);
}, 1100); }, 1100);
if(closestProperty.streamingRadioStation != -1) { if (closestProperty.streamingRadioStation != -1) {
if(getRadioStationData(closestProperty.streamingRadioStation)) { if (getRadioStationData(closestProperty.streamingRadioStation)) {
playRadioStreamForPlayer(client, getRadioStationData(closestProperty.streamingRadioStation).url); playRadioStreamForPlayer(client, getRadioStationData(closestProperty.streamingRadioStation).url);
getPlayerData(client).streamingRadioStation = closestProperty.streamingRadioStation; getPlayerData(client).streamingRadioStation = closestProperty.streamingRadioStation;
} }
@@ -240,8 +240,8 @@ function enterExitPropertyCommand(command, params, client) {
return true; return true;
} }
} else { } else {
if(getDistance(closestProperty.exitPosition, getPlayerPosition(client)) <= getGlobalConfig().exitPropertyDistance) { if (getDistance(closestProperty.exitPosition, getPlayerPosition(client)) <= getGlobalConfig().exitPropertyDistance) {
if(closestProperty.locked) { if (closestProperty.locked) {
meActionToNearbyPlayers(client, getLocaleString(client, "EnterExitPropertyDoorLocked", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House"))); meActionToNearbyPlayers(client, getLocaleString(client, "EnterExitPropertyDoorLocked", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House")));
return false; return false;
} }
@@ -249,19 +249,19 @@ function enterExitPropertyCommand(command, params, client) {
clearPlayerStateToEnterExitProperty(client) clearPlayerStateToEnterExitProperty(client)
meActionToNearbyPlayers(client, getLocaleString(client, "ExitsProperty", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House"))); meActionToNearbyPlayers(client, getLocaleString(client, "ExitsProperty", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House")));
if(isFadeCameraSupported()) { if (isFadeCameraSupported()) {
fadeCamera(client, false, 1.0); fadeCamera(client, false, 1.0);
} }
disableCityAmbienceForPlayer(client, true); disableCityAmbienceForPlayer(client, true);
setTimeout(function() { setTimeout(function () {
setPlayerInCutsceneInterior(client, closestProperty.entranceCutscene); setPlayerInCutsceneInterior(client, closestProperty.entranceCutscene);
setPlayerPosition(client, closestProperty.entrancePosition); setPlayerPosition(client, closestProperty.entrancePosition);
setPlayerHeading(client, closestProperty.entranceRotation); setPlayerHeading(client, closestProperty.entranceRotation);
setPlayerDimension(client, closestProperty.entranceDimension); setPlayerDimension(client, closestProperty.entranceDimension);
setPlayerInterior(client, closestProperty.entranceInterior); setPlayerInterior(client, closestProperty.entranceInterior);
setTimeout(function() { setTimeout(function () {
if(isFadeCameraSupported()) { if (isFadeCameraSupported()) {
fadeCamera(client, true, 1.0); fadeCamera(client, true, 1.0);
} }
@@ -285,11 +285,11 @@ function enterExitPropertyCommand(command, params, client) {
function getPlayerInfoCommand(command, params, client) { function getPlayerInfoCommand(command, params, client) {
let targetClient = client; let targetClient = client;
if(!areParamsEmpty(params)) { if (!areParamsEmpty(params)) {
if(doesPlayerHaveStaffPermission(client, getStaffFlagValue("BasicModeration"))) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("BasicModeration"))) {
targetClient = getPlayerFromParams(params); targetClient = getPlayerFromParams(params);
if(!getPlayerData(targetClient)) { if (!getPlayerData(targetClient)) {
messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));
return false; return false;
} }
@@ -317,7 +317,7 @@ function getPlayerInfoCommand(command, params, client) {
let stats = tempStats.map(stat => `{MAINCOLOUR}${stat[0]}: {ALTCOLOUR}${stat[1]}{MAINCOLOUR}`); let stats = tempStats.map(stat => `{MAINCOLOUR}${stat[0]}: {ALTCOLOUR}${stat[1]}{MAINCOLOUR}`);
let chunkedList = splitArrayIntoChunks(stats, 6); let chunkedList = splitArrayIntoChunks(stats, 6);
for(let i in chunkedList) { for (let i in chunkedList) {
messagePlayerInfo(client, chunkedList[i].join(", ")); messagePlayerInfo(client, chunkedList[i].join(", "));
} }
} }
@@ -325,7 +325,7 @@ function getPlayerInfoCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function playerChangeAFKState(client, afkState) { function playerChangeAFKState(client, afkState) {
if(!getPlayerData(client)) { if (!getPlayerData(client)) {
return false; return false;
} }
@@ -337,12 +337,12 @@ function playerChangeAFKState(client, afkState) {
function checkPlayerSpawning() { function checkPlayerSpawning() {
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(!isConsole(clients[i])) { if (!isConsole(clients[i])) {
if(getPlayerData(clients[i])) { if (getPlayerData(clients[i])) {
if(isPlayerLoggedIn(clients[i])) { if (isPlayerLoggedIn(clients[i])) {
if(!getPlayerData(clients[i]).ped) { if (!getPlayerData(clients[i]).ped) {
if(clients[i].player != null) { if (clients[i].player != null) {
//getPlayerData(clients[i]).ped = clients[i].player; //getPlayerData(clients[i]).ped = clients[i].player;
onPlayerSpawn(clients[i].player); onPlayerSpawn(clients[i].player);
} }
@@ -356,7 +356,7 @@ function checkPlayerSpawning() {
// =========================================================================== // ===========================================================================
function showPlayerPrompt(client, promptMessage, promptTitle, yesButtonText, noButtonText) { function showPlayerPrompt(client, promptMessage, promptTitle, yesButtonText, noButtonText) {
if(canPlayerUseGUI(client)) { if (canPlayerUseGUI(client)) {
showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText, noButtonText); showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText, noButtonText);
} else { } else {
messagePlayerNormal(client, `${promptMessage}`); messagePlayerNormal(client, `${promptMessage}`);
@@ -376,7 +376,7 @@ function showPlayerPrompt(client, promptMessage, promptTitle, yesButtonText, noB
* *
*/ */
function updateServerGameTime() { function updateServerGameTime() {
if(isTimeSupported()) { if (isTimeSupported()) {
game.time.hour = getServerConfig().hour; game.time.hour = getServerConfig().hour;
game.time.minute = getServerConfig().minute; game.time.minute = getServerConfig().minute;
} }
@@ -399,10 +399,10 @@ function listOnlineAdminsCommand(command, params, client) {
let admins = []; let admins = [];
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(getPlayerData(clients[i])) { if (getPlayerData(clients[i])) {
if(typeof getPlayerData(clients[i]).accountData.flags.admin != "undefined") { if (typeof getPlayerData(clients[i]).accountData.flags.admin != "undefined") {
if(getPlayerData(clients[i]).accountData.flags.admin > 0 || getPlayerData(clients[i]).accountData.flags.admin == -1) { if (getPlayerData(clients[i]).accountData.flags.admin > 0 || getPlayerData(clients[i]).accountData.flags.admin == -1) {
admins.push(`{ALTCOLOUR}[${getPlayerData(clients[i]).accountData.staffTitle}] {MAINCOLOUR}${getCharacterFullName(clients[i])}`); admins.push(`{ALTCOLOUR}[${getPlayerData(clients[i]).accountData.staffTitle}] {MAINCOLOUR}${getCharacterFullName(clients[i])}`);
} }
} }
@@ -410,7 +410,7 @@ function listOnlineAdminsCommand(command, params, client) {
} }
let chunkedList = splitArrayIntoChunks(admins, 3); let chunkedList = splitArrayIntoChunks(admins, 3);
for(let i in chunkedList) { for (let i in chunkedList) {
messagePlayerInfo(client, chunkedList[i].join(", ")); messagePlayerInfo(client, chunkedList[i].join(", "));
} }
} }
@@ -433,7 +433,7 @@ function gpsCommand(command, params, client) {
let useType = VRR_ITEM_USETYPE_NONE; let useType = VRR_ITEM_USETYPE_NONE;
let blipColour = "white"; let blipColour = "white";
switch(toLowerCase(params)) { switch (toLowerCase(params)) {
case "police": case "police":
case "policestation": case "policestation":
blipColour = "mediumGrey" blipColour = "mediumGrey"
@@ -512,32 +512,32 @@ function gpsCommand(command, params, client) {
default: { default: {
let itemTypeId = getItemTypeFromParams(params); let itemTypeId = getItemTypeFromParams(params);
if(getItemTypeData(itemTypeId) != false) { if (getItemTypeData(itemTypeId) != false) {
locationType = VRR_GPS_TYPE_BUSINESS; locationType = VRR_GPS_TYPE_BUSINESS;
blipColour = "mediumGrey"; blipColour = "mediumGrey";
useType = getItemTypeData(itemTypeId).useType; useType = getItemTypeData(itemTypeId).useType;
} else { } else {
let gameLocationId = getGameLocationFromParams(params); let gameLocationId = getGameLocationFromParams(params);
if(gameLocationId != false) { if (gameLocationId != false) {
position = getGameConfig().locations[getGame()][gameLocationId][1] position = getGameConfig().locations[getGame()][gameLocationId][1]
} }
} }
} }
} }
if(locationType == VRR_GPS_TYPE_NONE) { if (locationType == VRR_GPS_TYPE_NONE) {
messagePlayerError(client, getLocaleString(client, "InvalidGPSLocation")); messagePlayerError(client, getLocaleString(client, "InvalidGPSLocation"));
return false; return false;
} }
if(locationType == VRR_GPS_TYPE_BUSINESS) { if (locationType == VRR_GPS_TYPE_BUSINESS) {
let businessId = getClosestBusinessWithBuyableItemOfUseType(useType); let businessId = getClosestBusinessWithBuyableItemOfUseType(useType);
if(!businessId) { if (!businessId) {
messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType")); messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType"));
return false; return false;
} }
if(!getBusinessData(businessId)) { if (!getBusinessData(businessId)) {
messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType")); messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType"));
return false; return false;
} }
@@ -547,7 +547,7 @@ function gpsCommand(command, params, client) {
messagePlayerSuccess(client, "Look for the blinking icon on your mini map"); messagePlayerSuccess(client, "Look for the blinking icon on your mini map");
} }
if(locationType == VRR_GPS_TYPE_GAMELOC) { if (locationType == VRR_GPS_TYPE_GAMELOC) {
hideAllBlipsForPlayerGPS(client); hideAllBlipsForPlayerGPS(client);
blinkGenericGPSBlipForPlayer(client, position, 0, getColourByType(blipColour), 10); blinkGenericGPSBlipForPlayer(client, position, 0, getColourByType(blipColour), 10);
messagePlayerSuccess(client, "Look for the blinking icon on your mini map"); messagePlayerSuccess(client, "Look for the blinking icon on your mini map");
@@ -567,7 +567,7 @@ function gpsCommand(command, params, client) {
* *
*/ */
function stuckPlayerCommand(command, params, client) { function stuckPlayerCommand(command, params, client) {
if((getCurrentUnixTimestamp()-getPlayerData(client).lastStuckCommand) < getGlobalConfig().stuckCommandInterval) { if ((getCurrentUnixTimestamp() - getPlayerData(client).lastStuckCommand) < getGlobalConfig().stuckCommandInterval) {
messagePlayerError(client, "CantUseCommandYet"); messagePlayerError(client, "CantUseCommandYet");
return false; return false;
} }
@@ -577,8 +577,8 @@ function stuckPlayerCommand(command, params, client) {
messagePlayerAlert(client, getLocaleString(client, "FixingStuck")); messagePlayerAlert(client, getLocaleString(client, "FixingStuck"));
if(getGameConfig().skinChangePosition[getGame()].length > 0) { if (getGameConfig().skinChangePosition[getGame()].length > 0) {
if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) { if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) {
messagePlayerAlert(client, "You canceled the skin change."); messagePlayerAlert(client, "You canceled the skin change.");
restorePlayerCamera(client); restorePlayerCamera(client);
@@ -601,10 +601,10 @@ function stuckPlayerCommand(command, params, client) {
// return false; // return false;
//} //}
if(dimension > 0) { if (dimension > 0) {
let businesses = getServerData().businesses; let businesses = getServerData().businesses;
for(let i in businesses) { for (let i in businesses) {
if(businesses[i].exitDimension == dimension) { if (businesses[i].exitDimension == dimension) {
setPlayerPosition(client, businesses[i].entrancePosition); setPlayerPosition(client, businesses[i].entrancePosition);
setPlayerDimension(client, businesses[i].entranceDimension); setPlayerDimension(client, businesses[i].entranceDimension);
setPlayerInterior(client, businesses[i].entranceInterior); setPlayerInterior(client, businesses[i].entranceInterior);
@@ -614,8 +614,8 @@ function stuckPlayerCommand(command, params, client) {
} }
let houses = getServerData().houses; let houses = getServerData().houses;
for(let i in houses) { for (let i in houses) {
if(houses[i].exitDimension == dimension) { if (houses[i].exitDimension == dimension) {
setPlayerPosition(client, houses[i].entrancePosition); setPlayerPosition(client, houses[i].entrancePosition);
setPlayerDimension(client, houses[i].entranceDimension); setPlayerDimension(client, houses[i].entranceDimension);
setPlayerInterior(client, houses[i].entranceInterior); setPlayerInterior(client, houses[i].entranceInterior);
@@ -646,7 +646,7 @@ function stuckPlayerCommand(command, params, client) {
* *
*/ */
function playerPedSpeakCommand(command, params, client) { function playerPedSpeakCommand(command, params, client) {
if(areParamsEmpty(params)) { if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command)); messagePlayerSyntax(client, getCommandSyntaxText(command));
return false; return false;
} }
@@ -666,15 +666,15 @@ function playerPedSpeakCommand(command, params, client) {
* *
*/ */
function lockCommand(command, params, client) { function lockCommand(command, params, client) {
if(isPlayerInAnyVehicle(client)) { if (isPlayerInAnyVehicle(client)) {
let vehicle = getPlayerVehicle(client); let vehicle = getPlayerVehicle(client);
if(!getVehicleData(vehicle)) { if (!getVehicleData(vehicle)) {
messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled")); messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled"));
return false; return false;
} }
if(!isPlayerInFrontVehicleSeat(client)) { if (!isPlayerInFrontVehicleSeat(client)) {
messagePlayerError(client, getLocaleString(client, "MustBeInVehicleFrontSeat")); messagePlayerError(client, getLocaleString(client, "MustBeInVehicleFrontSeat"));
return false; return false;
} }
@@ -687,13 +687,13 @@ function lockCommand(command, params, client) {
return true; return true;
} else { } else {
let vehicle = getClosestVehicle(getPlayerPosition(client)); let vehicle = getClosestVehicle(getPlayerPosition(client));
if(getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getGlobalConfig().vehicleLockDistance) { if (getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getGlobalConfig().vehicleLockDistance) {
if(!getVehicleData(vehicle)) { if (!getVehicleData(vehicle)) {
messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled")); messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled"));
return false; return false;
} }
if(!doesPlayerHaveVehicleKeys(client, vehicle)) { if (!doesPlayerHaveVehicleKeys(client, vehicle)) {
messagePlayerError(client, getLocaleString(client, "DontHaveVehicleKey")); messagePlayerError(client, getLocaleString(client, "DontHaveVehicleKey"));
return false; return false;
} }
@@ -708,8 +708,8 @@ function lockCommand(command, params, client) {
} }
let businessId = getPlayerBusiness(client); let businessId = getPlayerBusiness(client);
if(businessId != -1) { if (businessId != -1) {
if(!canPlayerManageBusiness(client, businessId)) { if (!canPlayerManageBusiness(client, businessId)) {
messagePlayerError(client, getLocaleString(client, "CantModifyBusiness")); messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false; return false;
} }
@@ -723,8 +723,8 @@ function lockCommand(command, params, client) {
} }
let houseId = getPlayerHouse(client); let houseId = getPlayerHouse(client);
if(houseId != -1) { if (houseId != -1) {
if(!canPlayerManageHouse(client, houseId)) { if (!canPlayerManageHouse(client, houseId)) {
messagePlayerError(client, getLocaleString(client, "CantModifyHouse")); messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
return false; return false;
} }
@@ -750,16 +750,16 @@ function lockCommand(command, params, client) {
* @return {bool} Whether or not the command was successful * @return {bool} Whether or not the command was successful
* *
*/ */
function lightsCommand(command, params, client) { function lightsCommand(command, params, client) {
if(isPlayerInAnyVehicle(client)) { if (isPlayerInAnyVehicle(client)) {
let vehicle = getPlayerVehicle(client); let vehicle = getPlayerVehicle(client);
if(!getVehicleData(vehicle)) { if (!getVehicleData(vehicle)) {
messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled")); messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled"));
return false; return false;
} }
if(!isPlayerInFrontVehicleSeat(client)) { if (!isPlayerInFrontVehicleSeat(client)) {
messagePlayerError(client, getLocaleString(client, "MustBeInVehicleFrontSeat")); messagePlayerError(client, getLocaleString(client, "MustBeInVehicleFrontSeat"));
return false; return false;
} }
@@ -797,8 +797,8 @@ function lockCommand(command, params, client) {
*/ */
let businessId = getPlayerBusiness(client); let businessId = getPlayerBusiness(client);
if(businessId != -1) { if (businessId != -1) {
if(!canPlayerManageBusiness(client, businessId)) { if (!canPlayerManageBusiness(client, businessId)) {
messagePlayerError(client, getLocaleString(client, "CantModifyBusiness")); messagePlayerError(client, getLocaleString(client, "CantModifyBusiness"));
return false; return false;
} }
@@ -807,8 +807,8 @@ function lockCommand(command, params, client) {
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(getPlayerBusiness(client) == getPlayerBusiness(clients[i]) && getPlayerDimension(clients[i]) == getBusinessData(businessId).exitDimension) { if (getPlayerBusiness(client) == getPlayerBusiness(clients[i]) && getPlayerDimension(clients[i]) == getBusinessData(businessId).exitDimension) {
updateInteriorLightsForPlayer(clients[i], getBusinessData(businessId).interiorLights); updateInteriorLightsForPlayer(clients[i], getBusinessData(businessId).interiorLights);
} }
} }
@@ -818,8 +818,8 @@ function lockCommand(command, params, client) {
} }
let houseId = getPlayerHouse(client); let houseId = getPlayerHouse(client);
if(houseId != -1) { if (houseId != -1) {
if(!canPlayerManageHouse(client, houseId)) { if (!canPlayerManageHouse(client, houseId)) {
messagePlayerError(client, getLocaleString(client, "CantModifyHouse")); messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
return false; return false;
} }
@@ -828,8 +828,8 @@ function lockCommand(command, params, client) {
getHouseData(houseId).needsSaved = true; getHouseData(houseId).needsSaved = true;
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(getPlayerHouse(client) == getPlayerHouse(clients[i]) && getPlayerDimension(clients[i]) == getHouseData(houseId).exitDimension) { if (getPlayerHouse(client) == getPlayerHouse(clients[i]) && getPlayerDimension(clients[i]) == getHouseData(houseId).exitDimension) {
updateInteriorLightsForPlayer(clients[i], getHouseData(houseId).interiorLights); updateInteriorLightsForPlayer(clients[i], getHouseData(houseId).interiorLights);
} }
} }
@@ -838,4 +838,51 @@ function lockCommand(command, params, client) {
return true; return true;
} }
} }
}
// ===========================================================================
function resetPlayerBlip(client) {
deletePlayerBlip(client);
createPlayerBlip(client);
}
// ===========================================================================
function createPlayerBlip(client) {
if (!areServerElementsSupported()) {
return false;
}
if (!isGameFeatureSupported("attachedBlips")) {
return false;
}
if (getServerConfig().createPlayerBlips) {
return false;
}
let blip = createAttachedGameBlip(getPlayerPed(client), 0, 1, getPlayerColour(client));
if (blip) {
if (getGlobalConfig().playerBlipStreamInDistance == -1 || getGlobalConfig().playerBlipStreamOutDistance == -1) {
blip.netFlags.distanceStreaming = false;
} else {
setElementStreamInDistance(blip, getGlobalConfig().playerBlipStreamInDistance);
setElementStreamOutDistance(blip, getGlobalConfig().playerBlipStreamOutDistance);
}
getPlayerData(client).playerBlip = blip;
}
}
// ===========================================================================
function deletePlayerBlip(client) {
if (!isGameFeatureSupported("attachedBlips")) {
return false;
}
if (getPlayerData(client).playerBlip != false) {
destroyElement(getPlayerData(client).playerBlip);
getPlayerData(client).playerBlip = false;
}
} }

View File

@@ -40,10 +40,10 @@ let disconnectReasons = [
// =========================================================================== // ===========================================================================
function getPlayerPosition(client) { function getPlayerPosition(client) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return getPlayerData(client).syncPosition; return getPlayerData(client).syncPosition;
} else { } else {
if(getPlayerPed(client) != null) { if (getPlayerPed(client) != null) {
return getPlayerPed(client).position; return getPlayerPed(client).position;
} }
} }
@@ -59,10 +59,10 @@ function setPlayerPosition(client, position) {
// =========================================================================== // ===========================================================================
function getPlayerHeading(client) { function getPlayerHeading(client) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return getPlayerData(client).syncHeading; return getPlayerData(client).syncHeading;
} else { } else {
if(getPlayerPed(client) != null) { if (getPlayerPed(client) != null) {
return getPlayerPed(client).heading; return getPlayerPed(client).heading;
} }
} }
@@ -78,10 +78,10 @@ function setPlayerHeading(client, heading) {
// =========================================================================== // ===========================================================================
function getPlayerVehicle(client) { function getPlayerVehicle(client) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return getPlayerData().syncVehicle; return getPlayerData().syncVehicle;
} else { } else {
if(getPlayerPed(client).vehicle) { if (getPlayerPed(client).vehicle) {
return getPlayerPed(client).vehicle; return getPlayerPed(client).vehicle;
} }
} }
@@ -91,10 +91,10 @@ function getPlayerVehicle(client) {
// =========================================================================== // ===========================================================================
function getPlayerDimension(client) { function getPlayerDimension(client) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return getPlayerData(client).syncDimension; return getPlayerData(client).syncDimension;
} else { } else {
if(getPlayerPed(client) != null) { if (getPlayerPed(client) != null) {
return getPlayerPed(client).dimension; return getPlayerPed(client).dimension;
} }
} }
@@ -110,10 +110,10 @@ function getPlayerInterior(client) {
function setPlayerDimension(client, dimension) { function setPlayerDimension(client, dimension) {
logToConsole(LOG_VERBOSE, `Setting ${getPlayerDisplayForConsole(client)}'s dimension to ${dimension}`); logToConsole(LOG_VERBOSE, `Setting ${getPlayerDisplayForConsole(client)}'s dimension to ${dimension}`);
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
getPlayerData(client).syncDimension = dimension; getPlayerData(client).syncDimension = dimension;
} else { } else {
if(getPlayerPed(client) != null) { if (getPlayerPed(client) != null) {
getPlayerPed(client).dimension = dimension; getPlayerPed(client).dimension = dimension;
} }
} }
@@ -124,7 +124,7 @@ function setPlayerDimension(client, dimension) {
function setPlayerInterior(client, interior) { function setPlayerInterior(client, interior) {
logToConsole(LOG_VERBOSE, `Setting ${getPlayerDisplayForConsole(client)}'s interior to ${interior}`); logToConsole(LOG_VERBOSE, `Setting ${getPlayerDisplayForConsole(client)}'s interior to ${interior}`);
sendPlayerSetInterior(client, interior); sendPlayerSetInterior(client, interior);
if(isPlayerLoggedIn(client) && isPlayerSpawned(client)) { if (isPlayerLoggedIn(client) && isPlayerSpawned(client)) {
getPlayerCurrentSubAccount(client).interior = interior; getPlayerCurrentSubAccount(client).interior = interior;
} }
} }
@@ -132,7 +132,7 @@ function setPlayerInterior(client, interior) {
// =========================================================================== // ===========================================================================
function isPlayerInAnyVehicle(client) { function isPlayerInAnyVehicle(client) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return (getPlayerData().syncVehicle != null); return (getPlayerData().syncVehicle != null);
} else { } else {
return (getPlayerPed(client).vehicle != null); return (getPlayerPed(client).vehicle != null);
@@ -142,15 +142,15 @@ function isPlayerInAnyVehicle(client) {
// =========================================================================== // ===========================================================================
function getPlayerVehicleSeat(client) { function getPlayerVehicleSeat(client) {
if(!isPlayerInAnyVehicle(client)) { if (!isPlayerInAnyVehicle(client)) {
return false; return false;
} }
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return getPlayerData().syncVehicleSeat; return getPlayerData().syncVehicleSeat;
} else { } else {
for(let i = 0 ; i <= 8 ; i++) { for (let i = 0; i <= 8; i++) {
if(getPlayerVehicle(client).getOccupant(i) == getPlayerPed(client)) { if (getPlayerVehicle(client).getOccupant(i) == getPlayerPed(client)) {
return i; return i;
} }
} }
@@ -180,7 +180,7 @@ function getVehicleHeading(vehicle) {
// =========================================================================== // ===========================================================================
function setVehicleHeading(vehicle, heading) { function setVehicleHeading(vehicle, heading) {
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
return sendNetworkEventToPlayer("vrr.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading); return sendNetworkEventToPlayer("vrr.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
} }
return vehicle.heading = heading; return vehicle.heading = heading;
@@ -189,20 +189,20 @@ function setVehicleHeading(vehicle, heading) {
// =========================================================================== // ===========================================================================
function getElementTransient(element) { function getElementTransient(element) {
if(typeof element.transient != "undefined") { if (typeof element.transient != "undefined") {
return element.transient; return element.transient;
} }
return false; return false;
} }
// =========================================================================== // ===========================================================================
function setElementTransient(element, state) { function setElementTransient(element, state) {
if(typeof element.transient != "undefined") { if (typeof element.transient != "undefined") {
element.transient = state; element.transient = state;
return true; return true;
} }
return false; return false;
} }
// =========================================================================== // ===========================================================================
@@ -214,8 +214,8 @@ function getVehicleSyncer(vehicle) {
// =========================================================================== // ===========================================================================
function getVehicleForNetworkEvent(vehicle) { function getVehicleForNetworkEvent(vehicle) {
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
if(getVehicleData(vehicle).ivNetworkId != -1) { if (getVehicleData(vehicle).ivNetworkId != -1) {
return getVehicleData(vehicle).ivNetworkId; return getVehicleData(vehicle).ivNetworkId;
} }
return -1; return -1;
@@ -227,11 +227,11 @@ function getVehicleForNetworkEvent(vehicle) {
function deleteGameElement(element) { function deleteGameElement(element) {
try { try {
if(element != null) { if (element != null) {
destroyElement(element); destroyElement(element);
return true; return true;
} }
} catch(error) { } catch (error) {
return false; return false;
} }
} }
@@ -254,7 +254,7 @@ function removePlayerFromVehicle(client) {
function setPlayerSkin(client, skinIndex) { function setPlayerSkin(client, skinIndex) {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`);
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
triggerNetworkEvent("vrr.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]); triggerNetworkEvent("vrr.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
} else { } else {
getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0]; getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0];
@@ -292,7 +292,7 @@ function setPlayerArmour(client, armour) {
// =========================================================================== // ===========================================================================
function getPlayerArmour(client) { function getPlayerArmour(client) {
if(areServerElementsSupported(client)) { if (areServerElementsSupported(client)) {
return getPlayerPed(client).armour; return getPlayerPed(client).armour;
} else { } else {
return getPlayerData(client).syncArmour; return getPlayerData(client).syncArmour;
@@ -302,11 +302,11 @@ function getPlayerArmour(client) {
// =========================================================================== // ===========================================================================
function setPlayerCash(client, amount) { function setPlayerCash(client, amount) {
if(client == null) { if (client == null) {
return false; return false;
} }
if(isNaN(amount)) { if (isNaN(amount)) {
return false; return false;
} }
@@ -317,11 +317,11 @@ function setPlayerCash(client, amount) {
// =========================================================================== // ===========================================================================
function givePlayerCash(client, amount) { function givePlayerCash(client, amount) {
if(client == null) { if (client == null) {
return false; return false;
} }
if(isNaN(amount)) { if (isNaN(amount)) {
return false; return false;
} }
@@ -332,11 +332,11 @@ function givePlayerCash(client, amount) {
// =========================================================================== // ===========================================================================
function takePlayerCash(client, amount) { function takePlayerCash(client, amount) {
if(client == null) { if (client == null) {
return false; return false;
} }
if(isNaN(amount)) { if (isNaN(amount)) {
return false; return false;
} }
@@ -368,7 +368,7 @@ function getPlayerWeaponAmmo(client) {
function setPlayerVelocity(client, velocity) { function setPlayerVelocity(client, velocity) {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s velocity to ${velocity.x}, ${velocity.y}, ${velocity.z}`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s velocity to ${velocity.x}, ${velocity.y}, ${velocity.z}`);
if(typeof getPlayerPed(client).velocity != "undefined") { if (typeof getPlayerPed(client).velocity != "undefined") {
getPlayerPed(client).velocity = velocity; getPlayerPed(client).velocity = velocity;
} }
} }
@@ -376,7 +376,7 @@ function setPlayerVelocity(client, velocity) {
// =========================================================================== // ===========================================================================
function getPlayerVelocity(client) { function getPlayerVelocity(client) {
if(typeof getPlayerPed(client).velocity != "undefined") { if (typeof getPlayerPed(client).velocity != "undefined") {
return getPlayerPed(client).velocity; return getPlayerPed(client).velocity;
} }
return toVector3(0.0, 0.0, 0.0); return toVector3(0.0, 0.0, 0.0);
@@ -385,7 +385,7 @@ function getPlayerVelocity(client) {
// =========================================================================== // ===========================================================================
function getElementDimension(element) { function getElementDimension(element) {
if(typeof element.dimension != "undefined") { if (typeof element.dimension != "undefined") {
return element.dimension; return element.dimension;
} }
return 0; return 0;
@@ -394,18 +394,18 @@ function getElementDimension(element) {
// =========================================================================== // ===========================================================================
function setElementDimension(element, dimension) { function setElementDimension(element, dimension) {
if(typeof element.dimension != "undefined") { if (typeof element.dimension != "undefined") {
logToConsole(LOG_VERBOSE, `Setting element ${element} (${element.id}) dimension to ${dimension}`); logToConsole(LOG_VERBOSE, `Setting element ${element} (${element.id}) dimension to ${dimension}`);
element.dimension = dimension; element.dimension = dimension;
return true; return true;
} }
return false; return false;
} }
// =========================================================================== // ===========================================================================
function setElementRotation(element, rotation) { function setElementRotation(element, rotation) {
if(typeof element.setRotation != "undefined") { if (typeof element.setRotation != "undefined") {
element.setRotation(rotation); element.setRotation(rotation);
} else { } else {
return element.rotation = rotation; return element.rotation = rotation;
@@ -415,24 +415,24 @@ function setElementRotation(element, rotation) {
// =========================================================================== // ===========================================================================
function givePlayerHealth(client, amount) { function givePlayerHealth(client, amount) {
if(getPlayerHealth(client)+amount > 100) { if (getPlayerHealth(client) + amount > 100) {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to 100`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to 100`);
setPlayerHealth(client, 100); setPlayerHealth(client, 100);
} else { } else {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to ${getPlayerHealth(client)+amount}`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to ${getPlayerHealth(client) + amount}`);
setPlayerHealth(client, getPlayerHealth(client)+amount); setPlayerHealth(client, getPlayerHealth(client) + amount);
} }
} }
// =========================================================================== // ===========================================================================
function givePlayerArmour(client, amount) { function givePlayerArmour(client, amount) {
if(getPlayerArmour(client)+amount > 100) { if (getPlayerArmour(client) + amount > 100) {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to 100`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to 100`);
setPlayerArmour(client, 100); setPlayerArmour(client, 100);
} else { } else {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to ${getPlayerArmour(client)+amount}`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to ${getPlayerArmour(client) + amount}`);
setPlayerArmour(client, getPlayerArmour(client)+amount); setPlayerArmour(client, getPlayerArmour(client) + amount);
} }
} }
@@ -469,7 +469,7 @@ function getServerName() {
// =========================================================================== // ===========================================================================
function createGamePickup(modelIndex, position, type) { function createGamePickup(modelIndex, position, type) {
if(!isGameFeatureSupported("pickups")) { if (!isGameFeatureSupported("pickups")) {
return false; return false;
} }
return game.createPickup(modelIndex, position, type); return game.createPickup(modelIndex, position, type);
@@ -478,7 +478,7 @@ function createGamePickup(modelIndex, position, type) {
// =========================================================================== // ===========================================================================
function createGameBlip(position, type = 0, size = 1, colour = toColour(255, 255, 255, 255)) { function createGameBlip(position, type = 0, size = 1, colour = toColour(255, 255, 255, 255)) {
if(!isGameFeatureSupported("blips")) { if (!isGameFeatureSupported("blips")) {
return false; return false;
} }
return game.createBlip(type, position, size, colour); return game.createBlip(type, position, size, colour);
@@ -487,7 +487,7 @@ function createGameBlip(position, type = 0, size = 1, colour = toColour(255, 255
// =========================================================================== // ===========================================================================
function createGameObject(modelIndex, position) { function createGameObject(modelIndex, position) {
if(!isGameFeatureSupported("objects")) { if (!isGameFeatureSupported("objects")) {
return false; return false;
} }
return game.createObject(getGameConfig().objects[getGame()][modelIndex][0], position); return game.createObject(getGameConfig().objects[getGame()][modelIndex][0], position);
@@ -496,13 +496,13 @@ function createGameObject(modelIndex, position) {
// =========================================================================== // ===========================================================================
function setElementOnAllDimensions(element, state) { function setElementOnAllDimensions(element, state) {
if(!isNull(element) && element != false) { if (!isNull(element) && element != false) {
if(typeof element.netFlags != "undefined") { if (typeof element.netFlags != "undefined") {
if(typeof element.netFlags.onAllDimensions != "undefined") { if (typeof element.netFlags.onAllDimensions != "undefined") {
element.netFlags.onAllDimensions = state; element.netFlags.onAllDimensions = state;
} }
} else { } else {
if(typeof element.onAllDimensions != "undefined") { if (typeof element.onAllDimensions != "undefined") {
element.onAllDimensions = state; element.onAllDimensions = state;
} }
} }
@@ -512,7 +512,7 @@ function setElementOnAllDimensions(element, state) {
// =========================================================================== // ===========================================================================
function destroyGameElement(element) { function destroyGameElement(element) {
if(!isNull(element) && element != false) { if (!isNull(element) && element != false) {
destroyElement(element); destroyElement(element);
} }
} }
@@ -532,7 +532,7 @@ function getPlayerLastVehicle(client) {
// =========================================================================== // ===========================================================================
function isVehicleObject(vehicle) { function isVehicleObject(vehicle) {
if(vehicle == null || vehicle == undefined) { if (vehicle == null || vehicle == undefined) {
return false; return false;
} }
return (vehicle.type == ELEMENT_VEHICLE); return (vehicle.type == ELEMENT_VEHICLE);
@@ -600,11 +600,11 @@ function setVehicleColours(vehicle, colour1, colour2, colour3 = -1, colour4 = -1
vehicle.colour1 = colour1; vehicle.colour1 = colour1;
vehicle.colour2 = colour2; vehicle.colour2 = colour2;
if(colour3 != -1) { if (colour3 != -1) {
vehicle.colour3 = colour3; vehicle.colour3 = colour3;
} }
if(colour4 != -1) { if (colour4 != -1) {
vehicle.colour4 = colour4; vehicle.colour4 = colour4;
} }
} }
@@ -612,7 +612,7 @@ function setVehicleColours(vehicle, colour1, colour2, colour3 = -1, colour4 = -1
// =========================================================================== // ===========================================================================
function createGameVehicle(modelIndex, position, heading, toClient = null) { function createGameVehicle(modelIndex, position, heading, toClient = null) {
if(areServerElementsSupported()) { if (areServerElementsSupported()) {
return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading); return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading);
} }
} }
@@ -620,9 +620,9 @@ function createGameVehicle(modelIndex, position, heading, toClient = null) {
// =========================================================================== // ===========================================================================
function createGamePed(modelIndex, position, heading, toClient = null) { function createGamePed(modelIndex, position, heading, toClient = null) {
if(areServerElementsSupported()) { if (areServerElementsSupported()) {
let ped = game.createPed(getGameConfig().skins[getGame()][modelIndex][0], position); let ped = game.createPed(getGameConfig().skins[getGame()][modelIndex][0], position);
if(ped) { if (ped) {
//ped.position = position; //ped.position = position;
ped.heading = heading; ped.heading = heading;
return ped; return ped;
@@ -635,10 +635,10 @@ function createGamePed(modelIndex, position, heading, toClient = null) {
// =========================================================================== // ===========================================================================
function getIsland(position) { function getIsland(position) {
if(getGame() == VRR_GAME_GTA_III) { if (getGame() == VRR_GAME_GTA_III) {
if(position.x > 616) { if (position.x > 616) {
return VRR_ISLAND_PORTLAND; return VRR_ISLAND_PORTLAND;
} else if(position.x < -283) { } else if (position.x < -283) {
return VRR_ISLAND_SHORESIDEVALE; return VRR_ISLAND_SHORESIDEVALE;
} }
return VRR_ISLAND_STAUNTON; return VRR_ISLAND_STAUNTON;
@@ -652,7 +652,7 @@ function getIsland(position) {
// =========================================================================== // ===========================================================================
function isValidVehicleModel(model) { function isValidVehicleModel(model) {
if(getVehicleModelIndexFromModel(model) != false) { if (getVehicleModelIndexFromModel(model) != false) {
return true; return true;
} }
@@ -662,7 +662,7 @@ function isValidVehicleModel(model) {
// =========================================================================== // ===========================================================================
function setGameTime(hour, minute, minuteDuration = 1000) { function setGameTime(hour, minute, minuteDuration = 1000) {
if(isTimeSupported()) { if (isTimeSupported()) {
game.time.hour = hour; game.time.hour = hour;
game.time.minute = minute; game.time.minute = minute;
game.time.minuteDuration = minuteDuration; game.time.minuteDuration = minuteDuration;
@@ -672,7 +672,7 @@ function setGameTime(hour, minute, minuteDuration = 1000) {
// =========================================================================== // ===========================================================================
function setGameWeather(weather) { function setGameWeather(weather) {
if(isWeatherSupported()) { if (isWeatherSupported()) {
mp.world.weather = weather; mp.world.weather = weather;
} }
} }
@@ -680,11 +680,11 @@ function setGameWeather(weather) {
// =========================================================================== // ===========================================================================
function setPlayerFightStyle(client, fightStyleId) { function setPlayerFightStyle(client, fightStyleId) {
if(!isPlayerSpawned(client)) { if (!isPlayerSpawned(client)) {
return false; return false;
} }
if(!areFightStylesSupported()) { if (!areFightStylesSupported()) {
return false; return false;
} }
@@ -738,7 +738,7 @@ function setElementCollisionsEnabled(element, state) {
// =========================================================================== // ===========================================================================
function isTaxiVehicle(vehicle) { function isTaxiVehicle(vehicle) {
if(taxiModels[getGame()].indexOf(vehicle.modelIndex) != -1) { if (taxiModels[getGame()].indexOf(vehicle.modelIndex) != -1) {
return true; return true;
} }
@@ -755,11 +755,11 @@ function getVehicleName(vehicle) {
// =========================================================================== // ===========================================================================
function getElementModel(element) { function getElementModel(element) {
if(typeof element.modelIndex != "undefined") { if (typeof element.modelIndex != "undefined") {
return element.modelIndex; return element.modelIndex;
} }
if(typeof element.model != "undefined") { if (typeof element.model != "undefined") {
return element.model; return element.model;
} }
} }
@@ -773,7 +773,7 @@ function givePlayerWeaponAmmo(client, ammo) {
// =========================================================================== // ===========================================================================
function getPlayerWeapon(client) { function getPlayerWeapon(client) {
if(areServerElementsSupported(client)) { if (areServerElementsSupported(client)) {
return getPlayerPed(client).weapon; return getPlayerPed(client).weapon;
} else { } else {
return getPlayerData(client).syncWeapon; return getPlayerData(client).syncWeapon;
@@ -783,11 +783,11 @@ function getPlayerWeapon(client) {
// =========================================================================== // ===========================================================================
function connectToDatabase() { function connectToDatabase() {
if(getDatabaseConfig().usePersistentConnection) { if (getDatabaseConfig().usePersistentConnection) {
if(persistentDatabaseConnection == null) { if (persistentDatabaseConnection == null) {
logToConsole(LOG_DEBUG, `[VRR.Database] Initializing database connection ...`); logToConsole(LOG_DEBUG, `[VRR.Database] Initializing database connection ...`);
persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port); persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
if(persistentDatabaseConnection.error) { if (persistentDatabaseConnection.error) {
logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`); logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
persistentDatabaseConnection = null; persistentDatabaseConnection = null;
return false; return false;
@@ -801,7 +801,7 @@ function connectToDatabase() {
} }
} else { } else {
let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port); let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
if(databaseConnection.error) { if (databaseConnection.error) {
logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`); logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
return false; return false;
} else { } else {
@@ -813,11 +813,11 @@ function connectToDatabase() {
// =========================================================================== // ===========================================================================
function disconnectFromDatabase(dbConnection) { function disconnectFromDatabase(dbConnection) {
if(!getDatabaseConfig().usePersistentConnection) { if (!getDatabaseConfig().usePersistentConnection) {
try { try {
dbConnection.close(); dbConnection.close();
logToConsole(LOG_DEBUG, `[VRR.Database] Database connection closed successfully`); logToConsole(LOG_DEBUG, `[VRR.Database] Database connection closed successfully`);
} catch(error) { } catch (error) {
logToConsole(LOG_ERROR, `[VRR.Database] Database connection could not be closed! (Error: ${error})`); logToConsole(LOG_ERROR, `[VRR.Database] Database connection could not be closed! (Error: ${error})`);
} }
} }
@@ -828,7 +828,7 @@ function disconnectFromDatabase(dbConnection) {
function queryDatabase(dbConnection, queryString, useThread = false) { function queryDatabase(dbConnection, queryString, useThread = false) {
logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`); logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`);
if(useThread == true) { if (useThread == true) {
Promise.resolve().then(() => { Promise.resolve().then(() => {
let queryResult = dbConnection.query(queryString); let queryResult = dbConnection.query(queryString);
return queryResult; return queryResult;
@@ -841,11 +841,11 @@ function queryDatabase(dbConnection, queryString, useThread = false) {
// =========================================================================== // ===========================================================================
function escapeDatabaseString(dbConnection, unsafeString = "") { function escapeDatabaseString(dbConnection, unsafeString = "") {
if(!dbConnection) { if (!dbConnection) {
dbConnection = connectToDatabase(); dbConnection = connectToDatabase();
} }
if(typeof unsafeString == "string") { if (typeof unsafeString == "string") {
return dbConnection.escapeString(unsafeString); return dbConnection.escapeString(unsafeString);
} }
return unsafeString; return unsafeString;
@@ -872,7 +872,7 @@ function getDatabaseError(dbConnection) {
// =========================================================================== // ===========================================================================
function freeDatabaseQuery(dbQuery) { function freeDatabaseQuery(dbQuery) {
if(dbQuery != null) { if (dbQuery != null) {
dbQuery.free(); dbQuery.free();
} }
return; return;
@@ -889,26 +889,26 @@ function fetchQueryAssoc(dbQuery) {
function quickDatabaseQuery(queryString) { function quickDatabaseQuery(queryString) {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
let insertId = 0; let insertId = 0;
if(dbConnection) { if (dbConnection) {
//logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`); //logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`);
let dbQuery = queryDatabase(dbConnection, queryString); let dbQuery = queryDatabase(dbConnection, queryString);
if(getDatabaseInsertId(dbConnection)) { if (getDatabaseInsertId(dbConnection)) {
insertId = getDatabaseInsertId(dbConnection); insertId = getDatabaseInsertId(dbConnection);
logToConsole(LOG_DEBUG, `[VRR.Database] Query returned insert id ${insertId}`); logToConsole(LOG_DEBUG, `[VRR.Database] Query returned insert id ${insertId}`);
} }
if(dbQuery) { if (dbQuery) {
try { try {
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
logToConsole(LOG_DEBUG, `[VRR.Database] Query result free'd successfully`); logToConsole(LOG_DEBUG, `[VRR.Database] Query result free'd successfully`);
} catch(error) { } catch (error) {
logToConsole(LOG_ERROR, `[VRR.Database] Query result could not be free'd! (Error: ${error})`); logToConsole(LOG_ERROR, `[VRR.Database] Query result could not be free'd! (Error: ${error})`);
} }
} }
disconnectFromDatabase(dbConnection); disconnectFromDatabase(dbConnection);
if(insertId != 0) { if (insertId != 0) {
return insertId; return insertId;
} }
@@ -920,26 +920,26 @@ function quickDatabaseQuery(queryString) {
// =========================================================================== // ===========================================================================
function executeDatabaseQueryCommand(command, params, client) { function executeDatabaseQueryCommand(command, params, client) {
if(areParamsEmpty(params)) { if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command)); messagePlayerSyntax(client, getCommandSyntaxText(command));
return false; return false;
} }
if(!targetClient) { if (!targetClient) {
messagePlayerError(client, "That player was not found!"); messagePlayerError(client, "That player was not found!");
return false; return false;
} }
if(targetCode == "") { if (targetCode == "") {
messagePlayerError(client, "You didn't enter any code!"); messagePlayerError(client, "You didn't enter any code!");
return false; return false;
} }
let success = quickDatabaseQuery(params); let success = quickDatabaseQuery(params);
if(!success) { if (!success) {
messagePlayerAlert(client, `Database query failed to execute: {ALTCOLOUR}${query}`); messagePlayerAlert(client, `Database query failed to execute: {ALTCOLOUR}${query}`);
} else if(typeof success != "boolean") { } else if (typeof success != "boolean") {
messagePlayeSuccess(client, `Database query successful: {ALTCOLOUR}${query}`); messagePlayeSuccess(client, `Database query successful: {ALTCOLOUR}${query}`);
messagePlayerInfo(client, `Returns: ${success}`); messagePlayerInfo(client, `Returns: ${success}`);
} else { } else {
@@ -953,9 +953,9 @@ function executeDatabaseQueryCommand(command, params, client) {
function setConstantsAsGlobalVariablesInDatabase() { function setConstantsAsGlobalVariablesInDatabase() {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
let entries = Object.entries(global); let entries = Object.entries(global);
for(let i in entries) { for (let i in entries) {
logToConsole(LOG_DEBUG, `[VRR.Database] Checking entry ${i} (${entries[i]})`); logToConsole(LOG_DEBUG, `[VRR.Database] Checking entry ${i} (${entries[i]})`);
if(toString(i).slice(0, 3).indexOf("VRR_") != -1) { if (toString(i).slice(0, 3).indexOf("VRR_") != -1) {
logToConsole(LOG_DEBUG, `[VRR.Database] Adding ${i} (${entries[i]}) to database global variables`); logToConsole(LOG_DEBUG, `[VRR.Database] Adding ${i} (${entries[i]}) to database global variables`);
} }
} }
@@ -967,13 +967,13 @@ function createDatabaseInsertQuery(tableName, data) {
let fields = []; let fields = [];
let values = []; let values = [];
for(let i in data) { for (let i in data) {
if(data[i][1] != "undefined" && data[i][1] != NaN && data[i][0] != 'NaN') { if (data[i][1] != "undefined" && data[i][1] != NaN && data[i][0] != 'NaN') {
if(data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') { if (data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') {
fields.push(data[i][0]); fields.push(data[i][0]);
if(typeof data[i][1] == "string") { if (typeof data[i][1] == "string") {
if(data[i][1] == "{UNIXTIMESTAMP}") { if (data[i][1] == "{UNIXTIMESTAMP}") {
values.push("UNIX_TIMESTAMP()"); values.push("UNIX_TIMESTAMP()");
} else { } else {
values.push(`'${data[i][1]}'`); values.push(`'${data[i][1]}'`);
@@ -994,11 +994,11 @@ function createDatabaseInsertQuery(tableName, data) {
function createDatabaseUpdateQuery(tableName, data, whereClause) { function createDatabaseUpdateQuery(tableName, data, whereClause) {
let values = []; let values = [];
for(let i in data) { for (let i in data) {
if(data[i][0] != "undefined" && data[i][0] != NaN && data[i][0] != 'NaN') { if (data[i][0] != "undefined" && data[i][0] != NaN && data[i][0] != 'NaN') {
if(data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') { if (data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') {
if(typeof data[i][1] == "string") { if (typeof data[i][1] == "string") {
if(data[i][1] == "{UNIXTIMESTAMP}") { if (data[i][1] == "{UNIXTIMESTAMP}") {
values.push(`${data[i][0]}=UNIX_TIMESTAMP()`); values.push(`${data[i][0]}=UNIX_TIMESTAMP()`);
} else { } else {
values.push(`${data[i][0]}='${data[i][1]}'`); values.push(`${data[i][0]}='${data[i][1]}'`);
@@ -1038,8 +1038,8 @@ function getElementId(element) {
function getClientFromIndex(index) { function getClientFromIndex(index) {
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(clients[i].index == index) { if (clients[i].index == index) {
return clients[i]; return clients[i];
} }
} }
@@ -1078,7 +1078,7 @@ function getClosestCivilian(position) {
// =========================================================================== // ===========================================================================
function getVehiclesInRange(position, range) { function getVehiclesInRange(position, range) {
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
return getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j); return getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j);
} }
return getElementsByTypeInRange(ELEMENT_VEHICLE, position, range); return getElementsByTypeInRange(ELEMENT_VEHICLE, position, range);
@@ -1099,8 +1099,8 @@ function getClosestElementByType(elementType, position) {
// =========================================================================== // ===========================================================================
function getVehicleFirstEmptySeat(vehicle) { function getVehicleFirstEmptySeat(vehicle) {
for(let i = 0; i <= 4; i++) { for (let i = 0; i <= 4; i++) {
if(vehicle.getOccupant(i) == null) { if (vehicle.getOccupant(i) == null) {
return i; return i;
} }
} }
@@ -1111,8 +1111,8 @@ function getVehicleFirstEmptySeat(vehicle) {
// =========================================================================== // ===========================================================================
function isVehicleTrain(vehicle) { function isVehicleTrain(vehicle) {
if(getGame() == VRR_GAME_GTA_III) { if (getGame() == VRR_GAME_GTA_III) {
if(vehicle.modelIndex == 124) { if (vehicle.modelIndex == 124) {
return true; return true;
} }
} }
@@ -1155,9 +1155,9 @@ function setPlayerWantedLevel(client, wantedLevel) {
// =========================================================================== // ===========================================================================
function setElementStreamInDistance(element, distance) { function setElementStreamInDistance(element, distance) {
if(!isNull(element) && element != false) { if (!isNull(element) && element != false) {
if(typeof element == "Entity") { if (typeof element == "Entity") {
if(typeof element.streamInDistance != "undefined") { if (typeof element.streamInDistance != "undefined") {
element.streamInDistance = distance; element.streamInDistance = distance;
} }
} }
@@ -1167,9 +1167,9 @@ function setElementStreamInDistance(element, distance) {
// =========================================================================== // ===========================================================================
function setElementStreamOutDistance(element, distance) { function setElementStreamOutDistance(element, distance) {
if(!isNull(element) && element != false) { if (!isNull(element) && element != false) {
if(typeof element == "Entity") { if (typeof element == "Entity") {
if(typeof element.streamOutDistance != "undefined") { if (typeof element.streamOutDistance != "undefined") {
element.streamOutDistance = distance; element.streamOutDistance = distance;
} }
} }
@@ -1179,7 +1179,7 @@ function setElementStreamOutDistance(element, distance) {
// =========================================================================== // ===========================================================================
function getPlayerPed(client) { function getPlayerPed(client) {
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
return getPlayerData(client).ped; return getPlayerData(client).ped;
} else { } else {
return client.player; return client.player;
@@ -1189,8 +1189,8 @@ function getPlayerPed(client) {
// =========================================================================== // ===========================================================================
function setEntityData(entity, dataName, dataValue, syncToClients = true) { function setEntityData(entity, dataName, dataValue, syncToClients = true) {
if(entity != null) { if (entity != null) {
if(areServerElementsSupported()) { if (areServerElementsSupported()) {
return entity.setData(dataName, dataValue, syncToClients); return entity.setData(dataName, dataValue, syncToClients);
} }
} }
@@ -1200,8 +1200,8 @@ function setEntityData(entity, dataName, dataValue, syncToClients = true) {
// =========================================================================== // ===========================================================================
function removeEntityData(entity, dataName) { function removeEntityData(entity, dataName) {
if(entity != null) { if (entity != null) {
if(areServerElementsSupported()) { if (areServerElementsSupported()) {
return entity.removeData(dataName); return entity.removeData(dataName);
} }
} }
@@ -1211,8 +1211,8 @@ function removeEntityData(entity, dataName) {
// =========================================================================== // ===========================================================================
function doesEntityDataExist(entity, dataName) { function doesEntityDataExist(entity, dataName) {
if(entity != null) { if (entity != null) {
if(areServerElementsSupported()) { if (areServerElementsSupported()) {
return (entity.getData(dataName) != null); return (entity.getData(dataName) != null);
} else { } else {
return false; return false;
@@ -1266,7 +1266,7 @@ function getGame() {
// =========================================================================== // ===========================================================================
function getCountryNameFromIP(ip) { function getCountryNameFromIP(ip) {
if(module.geoip.getCountryName(ip)) { if (module.geoip.getCountryName(ip)) {
return module.geoip.getCountryName(ip); return module.geoip.getCountryName(ip);
} }
return false; return false;
@@ -1331,9 +1331,9 @@ function addServerCommandHandler(command, handlerFunction) {
// =========================================================================== // ===========================================================================
function addServerEventHandler(eventName, handlerFunction) { function addServerEventHandler(eventName, handlerFunction) {
addEventHandler(eventName, function(event, ...args) { addEventHandler(eventName, function (event, ...args) {
let result = handlerFunction.apply(this, args); let result = handlerFunction.apply(this, args);
if(result == false) { if (result == false) {
event.preventDefault(); event.preventDefault();
} }
}); });
@@ -1342,9 +1342,9 @@ function addServerEventHandler(eventName, handlerFunction) {
// =========================================================================== // ===========================================================================
function bindServerEventHandler(eventName, bindTo, handlerFunction) { function bindServerEventHandler(eventName, bindTo, handlerFunction) {
addEventHandler(eventName, bindTo, function(event, ...args) { addEventHandler(eventName, bindTo, function (event, ...args) {
let result = handlerFunction.apply(this, args); let result = handlerFunction.apply(this, args);
if(result == false) { if (result == false) {
event.preventDefault(); event.preventDefault();
} }
}); });
@@ -1374,4 +1374,12 @@ function setElementShownByDefault(element, state) {
element.netFlags.defaultExistance = state; element.netFlags.defaultExistance = state;
} }
// ===========================================================================
function createAttachedGameBlip(element, type, size, colour = toColour(255, 255, 255, 255)) {
if (isGameFeatureSupported("attachedBlips")) {
return game.createBlipAttachedTo(element, type, size, colour, true, false);
}
}
// =========================================================================== // ===========================================================================