Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Admin Menu Player Markers (2) #412

Merged
merged 8 commits into from
Jan 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Altis_Life.Altis/config/Config_SpyGlass.hpp
Expand Up @@ -235,7 +235,7 @@ class SpyGlass {
"life_fnc_adminspectate_meta","life_fnc_adminteleport","life_fnc_adminteleport_meta","life_fnc_admintphere","life_fnc_admintphere_meta","life_fnc_animsync","life_fnc_animsync_meta","life_fnc_arrestaction","life_fnc_arrestaction_meta","life_fnc_atmmenu","life_fnc_atmmenu_meta","life_fnc_bankdeposit","life_fnc_bankdeposit_meta","life_fnc_banktransfer",
"life_fnc_banktransfer_meta","life_fnc_bankwithdraw","life_fnc_bankwithdraw_meta","life_fnc_blastingcharge","life_fnc_blastingcharge_meta","life_fnc_boltcutter","life_fnc_boltcutter_meta","life_fnc_bountyreceive","life_fnc_bountyreceive_meta","life_fnc_broadcast","life_fnc_broadcast_meta","life_fnc_buyclothes","life_fnc_buyclothes_meta","life_fnc_buyhouse",
"life_fnc_buyhouse_meta","life_fnc_buyhousegarage","life_fnc_buyhousegarage_meta","life_fnc_buylicense","life_fnc_buylicense_meta","life_fnc_calweightdiff","life_fnc_calweightdiff_meta","life_fnc_capturehideout","life_fnc_capturehideout_meta","life_fnc_catchfish","life_fnc_catchfish_meta","life_fnc_catchturtle","life_fnc_catchturtle_meta","life_fnc_cellphone",
"life_fnc_cellphone_meta","life_fnc_changeclothes","life_fnc_changeclothes_meta","life_fnc_chopshopmenu","life_fnc_chopshopmenu_meta","life_fnc_chopshopselection","life_fnc_chopshopselection_meta","life_fnc_chopshopsell","life_fnc_chopshopsell_meta","life_fnc_civloadout","life_fnc_civloadout_meta","life_fnc_civmarkers","life_fnc_civmarkers_meta",
"life_fnc_cellphone_meta","life_fnc_checkmap","life_fnc_checkmap_meta","life_fnc_changeclothes","life_fnc_changeclothes_meta","life_fnc_chopshopmenu","life_fnc_chopshopmenu_meta","life_fnc_chopshopselection","life_fnc_chopshopselection_meta","life_fnc_chopshopsell","life_fnc_chopshopsell_meta","life_fnc_civloadout","life_fnc_civloadout_meta","life_fnc_civmarkers","life_fnc_civmarkers_meta",
"life_fnc_clearvehicleammo","life_fnc_clearvehicleammo_meta","life_fnc_clothingfilter","life_fnc_clothingfilter_meta","life_fnc_clothingmenu","life_fnc_clothingmenu_meta","life_fnc_colorvehicle","life_fnc_colorvehicle_meta","life_fnc_containerinvsearch","life_fnc_containerinvsearch_meta","life_fnc_containermenu","life_fnc_containermenu_meta","life_fnc_copbreakdoor",
"life_fnc_copbreakdoor_meta","life_fnc_cophouseowner","life_fnc_cophouseowner_meta","life_fnc_copinteractionmenu","life_fnc_copinteractionmenu_meta","life_fnc_coplights","life_fnc_coplights_meta","life_fnc_coploadout","life_fnc_coploadout_meta","life_fnc_copmarkers","life_fnc_copmarkers_meta","life_fnc_copsearch","life_fnc_copsearch_meta","life_fnc_copsiren",
"life_fnc_copsiren_meta","life_fnc_copsplit","life_fnc_copsplit_meta","life_fnc_corpse","life_fnc_corpse_meta","life_fnc_creategang","life_fnc_creategang_meta","life_fnc_deathscreen","life_fnc_deathscreen_meta","life_fnc_defusekit","life_fnc_defusekit_meta","life_fnc_demochargetimer","life_fnc_demochargetimer_meta","life_fnc_devicemine","life_fnc_devicemine_meta",
Expand Down Expand Up @@ -279,7 +279,7 @@ class SpyGlass {
"db_fnc_asynccall","db_fnc_bool","db_fnc_insertrequest","db_fnc_insertvehicle","db_fnc_mresarray","db_fnc_mresstring","db_fnc_mrestoarray","db_fnc_numbersafe","db_fnc_queryrequest","db_fnc_updatepartial","db_fnc_updaterequest","ton_fnc_addhouse","ton_fnc_addhouse_meta","ton_fnc_cell_adminmsg","ton_fnc_cell_adminmsgall","ton_fnc_cell_emsrequest","ton_fnc_cell_textadmin","ton_fnc_cell_textcop",
"ton_fnc_cell_textmsg","ton_fnc_chopshopsell","ton_fnc_chopshopsell_meta","ton_fnc_cleanup","ton_fnc_cleanup_meta","ton_fnc_cleanuprequest","ton_fnc_cleanuprequest_meta","ton_fnc_clientdisconnect","ton_fnc_clientdisconnect_meta","ton_fnc_clientgangkick","ton_fnc_clientgangleader","ton_fnc_clientgangleft","TON_fnc_clientGangLeft","ton_fnc_clientgetkey","ton_fnc_clientmessage","ton_fnc_federalupdate",
"ton_fnc_federalupdate_meta","ton_fnc_fetchplayerhouses","ton_fnc_fetchplayerhouses_meta","ton_fnc_getid","ton_fnc_getid_meta","ton_fnc_getvehicles","ton_fnc_getvehicles_meta","ton_fnc_housecleanup","ton_fnc_housecleanup_meta","ton_fnc_huntingzone","ton_fnc_huntingzone_meta","ton_fnc_index","ton_fnc_inithouses","ton_fnc_inithouses_meta","ton_fnc_insertgang","ton_fnc_insertgang_meta","ton_fnc_isnumber",
"ton_fnc_keymanagement","ton_fnc_keymanagement_meta","ton_fnc_managesc","ton_fnc_managesc_meta","ton_fnc_mapmarkersadmin","ton_fnc_pickupaction","ton_fnc_pickupaction_meta","ton_fnc_player_query","ton_fnc_queryplayergang","ton_fnc_queryplayergang_meta","ton_fnc_removegang","ton_fnc_removegang_meta","ton_fnc_sellhouse","ton_fnc_sellhouse_meta","ton_fnc_setobjvar","ton_fnc_setobjvar_meta","ton_fnc_spawnvehicle",
"ton_fnc_keymanagement","ton_fnc_keymanagement_meta","ton_fnc_managesc","ton_fnc_managesc_meta","ton_fnc_pickupaction","ton_fnc_pickupaction_meta","ton_fnc_player_query","ton_fnc_queryplayergang","ton_fnc_queryplayergang_meta","ton_fnc_removegang","ton_fnc_removegang_meta","ton_fnc_sellhouse","ton_fnc_sellhouse_meta","ton_fnc_setobjvar","ton_fnc_setobjvar_meta","ton_fnc_spawnvehicle",
"ton_fnc_spawnvehicle_meta","ton_fnc_spikestrip","ton_fnc_spikestrip_meta","ton_fnc_terrainsort","ton_fnc_terrainsort_meta","ton_fnc_updategang","ton_fnc_updategang_meta","ton_fnc_updatehousecontainers","ton_fnc_updatehousecontainers_meta","ton_fnc_updatehousetrunk","ton_fnc_updatehousetrunk_meta","ton_fnc_vehiclecreate","ton_fnc_vehiclecreate_meta","ton_fnc_vehicledead","ton_fnc_vehicledead_meta",
"ton_fnc_vehicledelete","ton_fnc_vehicledelete_meta","ton_fnc_vehiclestore","ton_fnc_vehiclestore_meta"
};
Expand Down Expand Up @@ -314,7 +314,7 @@ class SpyGlass {
{ "luce_1", "SCRIPT" }, { "life_bail_amount", "SCALAR" }, { "life_canpay_bail", "BOOL" }, { "hc_life", "SCALAR" }, { "life_fnc_requestclientid", "OBJECT" }, { "life_hc_isactive", "BOOL" }, { "ton_fnc_playtime_values", "ARRAY" }, { "ton_fnc_playtime_values_request", "ARRAY" }, { "hc_1", "OBJECT" }, { "hc_life", "BOOL" }, { "rscdisplaympinterrupt_respawntime", "SCALAR" }, { "bis_dynamictext_spawn_8", "SCRIPT" },
{ "life_my_gang", "OBJECT" }, {"am_exit","SCALAR"}, { "life_garage_sp", "ARRAY" }, { "life_garage_sp", "STRING" }, { "0", "ARRAY" }, { "life_oldvestitems", "ARRAY" }, { "life_shop_cam", "OBJECT" }, { "life_oldclothes", "STRING" }, { "life_cmenu_lock", "BOOL" }, { "life_oldhat", "STRING" }, { "life_oldvest", "STRING" }, { "life_oldglasses", "STRING" }, { "life_oldbackpackitems","ARRAY"},
{"life_oldbackpack","STRING"}, { "rscnotification_data", "ARRAY" }, { "life_curwep_h", "STRING" }, { "carshop_lux_1", "OBJECT" }, { "life_olduniformitems", "ARRAY" }, { "bis_fnc_setvehiclemass_fsm", "SCALAR" }, { "life_preview_light", "OBJECT" }, { "life_attachment_point", "OBJECT" }, { "life_preview_3d_vehicle_cam", "OBJECT" }, { "life_preview_3d_vehicle_object", "OBJECT" }, { "life_pos_exist", "BOOL" },
{ "life_pos_attach", "ARRAY" }, { "life_inv_", "SCALAR" }, { "life_markers", "BOOL" }, { "life_frozen", "BOOL" }, { "life_settings_revealobjects", "BOOL" }, { "life_inv_rooster", "SCALAR" }, { "station_shop_09", "OBJECT" }, { "station_shop_08", "OBJECT" }, { "station_shop_07", "OBJECT" }, { "station_shop_06", "OBJECT" }, { "station_shop_04", "OBJECT" }, { "life_disable_getout", "BOOL" },
{ "life_pos_attach", "ARRAY" }, { "life_inv_", "SCALAR" }, { "life_markers", "BOOL" }, { "life_markers_active", "BOOL" }, { "life_frozen", "BOOL" }, { "life_settings_revealobjects", "BOOL" }, { "life_inv_rooster", "SCALAR" }, { "station_shop_09", "OBJECT" }, { "station_shop_08", "OBJECT" }, { "station_shop_07", "OBJECT" }, { "station_shop_06", "OBJECT" }, { "station_shop_04", "OBJECT" }, { "life_disable_getout", "BOOL" },
{ "bis_taskenhancements_3d", "BOOL" }, { "life_settings_enablenewsbroadcast", "BOOL" }, { "life_settings_enablesidechannel", "BOOL" }, { "life_isknocked", "BOOL" }, { "life_settings_viewdistancecar", "SCALAR" }, { "life_save_gear", "ARRAY" }, { "life_settings_viewdistanceair", "SCALAR" }, { "life_disable_getin", "BOOL" }, { "life_god", "BOOL" }, { "station_shop_3", "OBJECT" }, { "station_shop_2", "OBJECT" },
{ "station_shop_1", "OBJECT" }, { "station_shop_24", "OBJECT" }, { "station_shop_23", "OBJECT" }, { "station_shop_22", "OBJECT" }, { "station_shop_21", "OBJECT" }, { "station_shop_20", "OBJECT" }, { "life_settings_viewdistancefoot", "SCALAR" }, { "life_settings_tagson", "BOOL" }, { "station_shop_19", "OBJECT" }, { "bis_taskenhancements_enable", "BOOL" }, { "station_shop_18", "OBJECT" }, { "station_shop_17", "OBJECT" },
{ "life_container_activeobj", "OBJECT" }, { "station_shop_16", "OBJECT" }, { "station_shop_15", "OBJECT" }, { "station_shop_14", "OBJECT" }, { "station_shop_13", "OBJECT" }, { "station_shop_12", "OBJECT" }, { "station_shop_11", "OBJECT" }, { "station_shop_10", "OBJECT" }, { "life_progress", "DISPLAY" }, { "life_veh_shop", "ARRAY" }, { "bis_fnc_feedback_deltadamage", "SCALAR" }, { "life_clothing_store", "STRING" },
Expand Down
44 changes: 40 additions & 4 deletions Altis_Life.Altis/core/admin/fn_adminMarkers.sqf
@@ -1,10 +1,46 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminMarkers.sqf
Author: NiiRoZz
Description:
Display markers for all players
Author: Jason_000
Description: Display markers for all players
*/

params [
["_reOpen", false, [false]]
];

if (FETCH_CONST(life_adminlevel) < 4) exitWith {closeDialog 0; hint localize "STR_ANOTF_ErrorLevel";};

[] spawn TON_fnc_MapMarkersAdmin;
life_markers_active = true;

if !(_reOpen) then {
life_markers = !life_markers;
hint localize (["STR_ANOTF_MDisabled", "STR_ANOTF_MEnabled"] select life_markers);
};

for "_i" from 0 to 1 step 0 do {
if !(life_markers && {life_markers_active}) exitWith {};
private _markers = [];

{
private _colour = switch (side _x) do {
case west: {"colorBLUFOR"};
case independent: {"colorIndependent"};
case east: {"colorOPFOR"};
default {"colorCivilian"};
};

private _name = name _x;
createMarkerLocal[_name, position _x];
_name setMarkerTypeLocal "mil_dot";
_name setMarkerColorLocal _colour;
_name setMarkerTextLocal _name;
_markers pushBack _name;
true

} count (allPlayers - entities "HeadlessClient_F");

sleep 0.5;
{deleteMarkerLocal _x} count _markers;

};
1 change: 1 addition & 0 deletions Altis_Life.Altis/core/configuration.sqf
Expand Up @@ -47,6 +47,7 @@ life_pos_exist = false;
life_pos_attach = [];
life_civ_position = [];
life_markers = false;
life_markers_active = false;
life_canpay_bail = true;
life_storagePlacing = scriptNull;

Expand Down
4 changes: 3 additions & 1 deletion Altis_Life.Altis/core/fn_setupEVH.sqf
Expand Up @@ -12,4 +12,6 @@ player addEventHandler ["Take", {_this call life_fnc_onTakeItem}];
player addEventHandler ["Fired", {_this call life_fnc_onFired}];
player addEventHandler ["InventoryClosed", {_this call life_fnc_inventoryClosed}];
player addEventHandler ["InventoryOpened", {_this call life_fnc_inventoryOpened}];
player addEventHandler ["HandleRating", {0}];
player addEventHandler ["HandleRating", {0}];

addMissionEventHandler ["Map", {_this call life_fnc_checkMap}];
25 changes: 25 additions & 0 deletions Altis_Life.Altis/core/functions/fn_checkMap.sqf
@@ -0,0 +1,25 @@
/*
File: fn_checkMap.sqf
Author: DomT602
Description:
Checks if the map is being opened or closed, then puts markers according to side.
*/

params [
["_mapOpen",false,[false]]
];

if (_mapOpen) then {
switch playerSide do {
case west: {[] spawn life_fnc_copMarkers};
case independent: {[] spawn life_fnc_medicMarkers};
case civilian: {[] spawn life_fnc_civMarkers};
};

if (life_markers && {!(life_markers_active)}) then {
[true] spawn life_fnc_adminMarkers;
};

} else {
life_markers_active = false;
};
12 changes: 1 addition & 11 deletions Altis_Life.Altis/core/functions/fn_keyHandler.sqf
Expand Up @@ -6,7 +6,7 @@
* Description:
* Main key handler for event 'keyDown'.
*/
private ["_handled","_shift","_alt","_code","_ctrl","_alt","_ctrlKey","_veh","_locked","_interactionKey","_mapKey","_interruptionKeys"];
private ["_handled","_shift","_alt","_code","_ctrl","_alt","_ctrlKey","_veh","_locked","_interactionKey","_interruptionKeys"];
_ctrl = _this select 0;
_code = _this select 1;
_shift = _this select 2;
Expand All @@ -16,7 +16,6 @@ _speed = speed cursorObject;
_handled = false;

_interactionKey = if (count (actionKeys "User10") isEqualTo 0) then {219} else {(actionKeys "User10") select 0};
_mapKey = (actionKeys "ShowMap" select 0);
//hint str _code;
_interruptionKeys = [17,30,31,32]; //A,S,W,D

Expand Down Expand Up @@ -123,15 +122,6 @@ switch (_code) do {
};
};

//Map Key
case _mapKey: {
switch (playerSide) do {
case west: {if (!visibleMap) then {[] spawn life_fnc_copMarkers;}};
case independent: {if (!visibleMap) then {[] spawn life_fnc_medicMarkers;}};
case civilian: {if (!visibleMap) then {[] spawn life_fnc_civMarkers;}};
};
};

//Holster / recall weapon. (Shift + H)
case 35: {
if (_shift && !_ctrlKey && !(currentWeapon player isEqualTo "")) then {
Expand Down
106 changes: 0 additions & 106 deletions life_server/functions.sqf
Expand Up @@ -322,109 +322,3 @@ compileFinal "
};
";
publicVariable "TON_fnc_clientMessage";

TON_fnc_MapMarkersAdmin = compileFinal "
life_markers_Vehicles = [];
life_markers_Players = [];
if (!life_markers) then {
life_markers = true;
hint localize ""STR_ANOTF_MEnabled"";
} else {
life_markers = false;
hint localize ""STR_ANOTF_MDisabled"";
};
for ""_i"" from 0 to 1 step 0 do {
if (!life_markers) exitWith {};
{
if ((vehicle _x isKindOf ""LandVehicle"") || (vehicle _x isKindOf ""Air"") || (vehicle _x isKindOf ""Ship"")) then {
if (count(crew vehicle _x) > 0) then {
{
if (!(_x in life_markers_Vehicles) && (alive _x) && (getPlayerUID _x != """")) then {
private [""_pos"", ""_Markers"", ""_Vehicle""];
_Vehicle = vehicle _x;
_pos = visiblePosition _x;
_Markers = createMarkerLocal[format [""CRW%1%2"", _pos select 0, _pos select 1], [(_pos select 0) + 20, _pos select 1, 0]];
_TypeVehicle = (getText(configFile >> 'CfgVehicles' >> (typeOf vehicle _x) >> 'displayName'));
_Markers setMarkerTextLocal format ['%1---%2---%3m', name _x, _TypeVehicle, round(_x distance player)];
_Markers setMarkerTypeLocal ""mil_dot"";
if (side _x isEqualTo independent) then {
_Markers setMarkerColorLocal (""ColorIndependent"");
};
if (side _x isEqualTo civilian) then {
_Markers setMarkerColorLocal (""ColorCivilian"");
};
if (side _x isEqualTo west) then {
_Markers setMarkerColorLocal (""ColorBLUFOR"");
};
_Markers setMarkerSizeLocal[1, 1];
life_markers_Vehicles pushBack _x;
[_x, _Markers, _Vehicle, _TypeVehicle] spawn {
private [""_PlayersOrVehicles"", ""_Marker"", ""_CrewVehicle""];
_PlayersOrVehicles = _this select 0;
_Marker = _this select 1;
_TypeVehicle = _this select 3;
for ""_i"" from 0 to 1 step 0 do {
if (!life_markers && !(alive _PlayersOrVehicles) && (vehicle _PlayersOrVehicles == _PlayersOrVehicles) && (getPlayerUID _PlayersOrVehicles != """")) exitWith {};
_CrewVehicle = ((crew vehicle _PlayersOrVehicles) find _PlayersOrVehicles);
_Marker setMarkerPosLocal([(visiblePosition _PlayersOrVehicles select 0) + 20, (visiblePosition _PlayersOrVehicles select 1) - (25 + _CrewVehicle * 20), 0]);
_Marker setMarkerTextLocal format ['%1---%2---%3m', name _PlayersOrVehicles, _TypeVehicle, round(_PlayersOrVehicles distance player)];
sleep 0.01;
};
deleteMarkerLocal _Marker;
if (_PlayersOrVehicles in life_markers_Vehicles) then {
life_markers_Vehicles deleteAt (life_markers_Vehicles find _PlayersOrVehicles);
};
true;
};
};
} forEach crew vehicle _x;
};
} else {
if (!(_x in life_markers_Players) && (vehicle _x == _x) && (getPlayerUID _x != """")) then {
private [""_pos"", ""_Markers""];
_pos = visiblePosition _x;
_Markers = createMarkerLocal[format [""PLR%1%2"", _pos select 0, _pos select 1], [(_pos select 0) + 20, _pos select 1, 0]];
_Markers setMarkerTypeLocal ""mil_dot"";
_Markers setMarkerSizeLocal[1, 1];
if (side _x isEqualTo independent) then {
_Markers setMarkerColorLocal (""ColorIndependent"");
};
if (side _x isEqualTo civilian) then {
_Markers setMarkerColorLocal (""ColorCivilian"");
};
if (side _x isEqualTo west) then {
_Markers setMarkerColorLocal (""ColorBLUFOR"");
};
_Markers setMarkerTextLocal format [""%1---%2"", name _x, round(_x distance player)];
if (_x == player) then {
_Markers setMarkerColorLocal ""ColorGreen"";
};
life_markers_Players pushBack _x;
[_x, _Markers] spawn {
private [""_PlayersOrVehicles"", ""_Marker""];
_PlayersOrVehicles = _this select 0;
_Marker = _this select 1;
for ""_i"" from 0 to 1 step 0 do {
if (!life_markers && !(alive _PlayersOrVehicles) && (vehicle _PlayersOrVehicles != _PlayersOrVehicles) && (getPlayerUID _PlayersOrVehicles != """")) exitWith {};
_Marker setMarkerPosLocal([visiblePosition _PlayersOrVehicles select 0, visiblePosition _PlayersOrVehicles select 1, 0]);
_Marker setMarkerTextLocal format [""%1---%2"", name _PlayersOrVehicles, round(_PlayersOrVehicles distance player)];
sleep 0.01;
};
deleteMarkerLocal _Marker;
if (_PlayersOrVehicles in life_markers_Players) then {
life_markers_Players deleteAt (life_markers_Players find _PlayersOrVehicles);
};
true;
};
};
};
} forEach playableUnits;
sleep 0.3;
};
{
_Markers = str _x;
deleteMarkerLocal _Markers;
} forEach playableUnits;
";

publicVariable "TON_fnc_MapMarkersAdmin";