diff --git a/.travis.yml b/.travis.yml old mode 100755 new mode 100644 diff --git a/Altis_Life.Altis/CfgRemoteExec.hpp b/Altis_Life.Altis/CfgRemoteExec.hpp index 40a37192f..d08d6d4bb 100644 --- a/Altis_Life.Altis/CfgRemoteExec.hpp +++ b/Altis_Life.Altis/CfgRemoteExec.hpp @@ -63,6 +63,7 @@ class CfgRemoteExec { F(life_fnc_wantedList,CLIENT) F(life_fnc_wireTransfer,CLIENT) F(life_fnc_gangBankResponse,CLIENT) + F(life_fnc_chopShopSold,CLIENT) F(SOCK_fnc_dataQuery,CLIENT) F(SOCK_fnc_insertPlayerInfo,CLIENT) F(SOCK_fnc_requestReceived,CLIENT) diff --git a/Altis_Life.Altis/Functions.hpp b/Altis_Life.Altis/Functions.hpp index 32ae32bba..97aa193fd 100644 --- a/Altis_Life.Altis/Functions.hpp +++ b/Altis_Life.Altis/Functions.hpp @@ -92,7 +92,6 @@ class Life_Client_Core { class Civilian { file = "core\civilian"; - class civLoadout {}; class civMarkers {}; class demoChargeTimer {}; class freezePlayer {}; @@ -120,7 +119,6 @@ class Life_Client_Core { class containerInvSearch {}; class copInteractionMenu {}; class copLights {}; - class copLoadout {}; class copMarkers {}; class copSearch {}; class copSiren {}; @@ -214,6 +212,7 @@ class Life_Client_Core { class revealObjects {}; class saveGear {}; class simDisable {}; + class startLoadout {}; class stripDownPlayer {}; class teleport {}; class whereAmI {}; @@ -276,7 +275,6 @@ class Life_Client_Core { file = "core\medical"; class deathScreen {}; class medicLights {}; - class medicLoadout {}; class medicMarkers {}; class medicRequest {}; class medicSiren {}; @@ -334,6 +332,7 @@ class Life_Client_Core { class chopShopMenu {}; class chopShopSelection {}; class chopShopSell {}; + class chopShopSold {}; class clothingFilter {}; class clothingMenu {}; class fuelLBchange {}; diff --git a/Altis_Life.Altis/config/Config_Loadouts.hpp b/Altis_Life.Altis/config/Config_Loadouts.hpp new file mode 100755 index 000000000..e5381c767 --- /dev/null +++ b/Altis_Life.Altis/config/Config_Loadouts.hpp @@ -0,0 +1,84 @@ +/* + class PLAYERSIDE { // PLAYERSIDE can be: WEST (for cops), CIV (for civ/reb), GUER (for medics), EAST (for opfor) + // NOTES: + // empty array means that nothing will be add on players + // if you put more than a uniform on the CIV's class, they will be selected randonly, + // otherwise, for the other teams, player will get the uniform related to his level + + itemType[] = { // itemType can be: uniform, vest, backpack, weapon, items or linkedItems + { "classname", "conditions" } + }; + }; +*/ +class Loadouts { + // COP + class WEST { + uniform[] = { + {"U_Rangemaster", "call life_copLevel >= 0"} + }; + vest[] = { + {"V_Rangemaster_belt", "call life_copLevel >= 0"} + }; + backpack[] = {}; + weapon[] = { + {"hgun_P07_snds_F", "call life_copLevel >= 0"} + }; + mags[] = { + {"16Rnd_9x21_Mag", 6, "call life_copLevel >= 0"} + }; + items[] = {}; + linkedItems[] = { + {"ItemMap", "call life_copLevel >= 0"}, + {"ItemCompass", "call life_copLevel >= 0"}, + {"ItemWatch", "call life_copLevel >= 0"} + }; + }; + + // CIV + class CIV { + uniform[] = { + {"U_C_Poloshirt_blue", "!life_is_arrested"}, + {"U_C_Poloshirt_burgundy", "!life_is_arrested"}, + {"U_C_Poloshirt_stripped", "!life_is_arrested"}, + {"U_C_Poloshirt_tricolour", "!life_is_arrested"}, + {"U_C_Poloshirt_salmon", "!life_is_arrested"}, + {"U_C_Poloshirt_redwhite", "!life_is_arrested"}, + {"U_C_Commoner1_1", "!life_is_arrested"} + }; + vest[] = {}; + backpack[] = {}; + weapon[] = {}; + mags[] = {}; + items[] = {}; + linkedItems[] = { + {"ItemMap", ""}, + {"ItemCompass", ""}, + {"ItemWatch", ""} + }; + }; + + // MED + class GUER { + uniform[] = { + {"U_Rangemaster", "call life_medicLevel >= 1"} + }; + vest[] = { + {"V_Rangemaster_belt", "call life_medicLevel >= 1"} + }; + backpack[] = {}; + weapon[] = { + {"hgun_P07_snds_F", "call life_medicLevel >= 1"} + }; + mags[] = { + {"16Rnd_9x21_Mag", 1, "call life_medicLevel >= 1"} + }; + items[] = { + {"FirstAidKit", 2, "call life_medicLevel >= 1"} + }; + linkedItems[] = { + {"ItemMap", "call life_medicLevel >= 1"}, + {"ItemCompass", "call life_medicLevel >= 1"}, + {"ItemWatch", "call life_medicLevel >= 1"} + }; + }; +}; diff --git a/Altis_Life.Altis/config/Config_Master.hpp b/Altis_Life.Altis/config/Config_Master.hpp index 1442b7dbc..7e24641db 100644 --- a/Altis_Life.Altis/config/Config_Master.hpp +++ b/Altis_Life.Altis/config/Config_Master.hpp @@ -229,3 +229,4 @@ class Life_Settings { #include "Config_Process.hpp" #include "Config_Housing.hpp" #include "Config_Garages.hpp" +#include "Config_Loadouts.hpp" \ No newline at end of file diff --git a/Altis_Life.Altis/config/Config_SpyGlass.hpp b/Altis_Life.Altis/config/Config_SpyGlass.hpp index 0e127e667..da5676e2f 100644 --- a/Altis_Life.Altis/config/Config_SpyGlass.hpp +++ b/Altis_Life.Altis/config/Config_SpyGlass.hpp @@ -244,9 +244,9 @@ 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_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_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_chopShopSold","life_fnc_chopShopSold_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_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_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", "life_fnc_displayhandler","life_fnc_displayhandler_meta","life_fnc_dooranimate","life_fnc_dooranimate_meta","life_fnc_dpfinish","life_fnc_dpfinish_meta","life_fnc_dropfishingnet","life_fnc_dropfishingnet_meta","life_fnc_dropitems","life_fnc_dropitems_meta","life_fnc_escinterupt","life_fnc_escinterupt_meta","life_fnc_escortaction","life_fnc_escortaction_meta", "life_fnc_fedcamdisplay","life_fnc_fedcamdisplay_meta","life_fnc_fetchcfgdetails","life_fnc_fetchcfgdetails_meta","life_fnc_fetchdeadgear","life_fnc_fetchdeadgear_meta","life_fnc_fetchvehinfo","life_fnc_fetchvehinfo_meta","life_fnc_flashbang","life_fnc_flashbang_meta","life_fnc_freezeplayer","life_fnc_freezeplayer_meta","life_fnc_fuellbchange","life_fnc_fuellbchange_meta", @@ -259,7 +259,7 @@ class SpyGlass { "life_fnc_itemweight","life_fnc_itemweight_meta","life_fnc_jail","life_fnc_jail_meta","life_fnc_jailme","life_fnc_jailme_meta","life_fnc_jailsys","life_fnc_jailsys_meta","life_fnc_jerrycanrefuel","life_fnc_jerrycanrefuel_meta","life_fnc_jerryrefuel","life_fnc_jerryrefuel_meta","life_fnc_jumpfnc","life_fnc_jumpfnc_meta","life_fnc_keydrop","life_fnc_keydrop_meta","life_fnc_keygive", "life_fnc_keygive_meta","life_fnc_keyhandler","life_fnc_keyhandler_meta","life_fnc_keymenu","life_fnc_keymenu_meta","life_fnc_knockedout","life_fnc_knockedout_meta","life_fnc_knockoutaction","life_fnc_knockoutaction_meta","life_fnc_levelcheck","life_fnc_levelcheck_meta","life_fnc_licensecheck","life_fnc_licensecheck_meta","life_fnc_licensesread","life_fnc_licensesread_meta","life_fnc_lighthouse", "life_fnc_lighthouse_meta","life_fnc_lighthouseaction","life_fnc_lighthouseaction_meta","life_fnc_loaddeadgear","life_fnc_loaddeadgear_meta","life_fnc_loadgear","life_fnc_loadgear_meta","life_fnc_lockhouse","life_fnc_lockhouse_meta","life_fnc_lockpick","life_fnc_lockpick_meta","life_fnc_lockuphouse","life_fnc_lockuphouse_meta","life_fnc_lockvehicle","life_fnc_lockvehicle_meta","life_fnc_mediclights", - "life_fnc_mediclights_meta","life_fnc_medicloadout","life_fnc_medicloadout_meta","life_fnc_medicmarkers","life_fnc_medicmarkers_meta","life_fnc_medicrequest","life_fnc_medicrequest_meta","life_fnc_medicsiren","life_fnc_medicsiren_meta","life_fnc_medicsirenlights","life_fnc_medicsirenlights_meta","life_fnc_mine","life_fnc_mine_meta","life_fnc_movein","life_fnc_movein_meta","life_fnc_nearatm","life_fnc_nearatm_meta", + "life_fnc_mediclights_meta","life_fnc_medicmarkers","life_fnc_medicmarkers_meta","life_fnc_medicrequest","life_fnc_medicrequest_meta","life_fnc_medicsiren","life_fnc_medicsiren_meta","life_fnc_medicsirenlights","life_fnc_medicsirenlights_meta","life_fnc_mine","life_fnc_mine_meta","life_fnc_movein","life_fnc_movein_meta","life_fnc_nearatm","life_fnc_nearatm_meta", "life_fnc_nearestdoor","life_fnc_nearestdoor_meta","life_fnc_nearestobjects","life_fnc_nearestobjects_meta","life_fnc_nearunits","life_fnc_nearunits_meta","life_fnc_newsbroadcast","life_fnc_newsbroadcast_meta","life_fnc_numbertext","life_fnc_numbertext_meta","life_fnc_onfired","life_fnc_onfired_meta","life_fnc_onplayerkilled","life_fnc_onplayerkilled_meta","life_fnc_onplayerrespawn", "life_fnc_onplayerrespawn_meta","life_fnc_ontakeitem","life_fnc_ontakeitem_meta","life_fnc_openinventory","life_fnc_openinventory_meta","life_fnc_p_changescreen","life_fnc_p_changescreen_meta","life_fnc_p_getscreengroupidc","life_fnc_p_getscreengroupidc_meta","life_fnc_p_handlescreenevent","life_fnc_p_handlescreenevent_meta","life_fnc_p_init","life_fnc_p_init_meta","life_fnc_p_initmainmenu", "life_fnc_p_initmainmenu_meta","life_fnc_p_onclick","life_fnc_p_onclick_meta","life_fnc_p_oneachframe","life_fnc_p_oneachframe_meta","life_fnc_p_onload","life_fnc_p_onload_meta","life_fnc_p_onmouseenter","life_fnc_p_onmouseenter_meta","life_fnc_p_onmouseexit","life_fnc_p_onmouseexit_meta","life_fnc_p_onunload","life_fnc_p_onunload_meta","life_fnc_p_openmenu","life_fnc_p_openmenu_meta", @@ -273,7 +273,7 @@ class SpyGlass { "life_fnc_seizeplayeraction_meta","life_fnc_sellgarage","life_fnc_sellgarage_meta","life_fnc_sellhouse","life_fnc_sellhouse_meta","life_fnc_sellhousegarage","life_fnc_sellhousegarage_meta","life_fnc_servicechopper","life_fnc_servicechopper_meta","life_fnc_setfuel","life_fnc_setfuel_meta","life_fnc_setmapposition","life_fnc_setmapposition_meta","life_fnc_settexture_meta","life_fnc_settingsmenu", "life_fnc_settingsmenu_meta","life_fnc_setupactions","life_fnc_setupactions_meta","life_fnc_setupevh","life_fnc_setupevh_meta","life_fnc_simdisable","life_fnc_simdisable_meta","life_fnc_sirenlights","life_fnc_sirenlights_meta","life_fnc_sounddevice","life_fnc_sounddevice_meta","life_fnc_spawnconfirm","life_fnc_spawnconfirm_meta","life_fnc_spawnmenu","life_fnc_spawnmenu_meta","life_fnc_spawnpointcfg", "life_fnc_spawnpointcfg_meta","life_fnc_spawnpointselected","life_fnc_spawnpointselected_meta","life_fnc_spikestrip","life_fnc_spikestrip_meta","life_fnc_spikestripeffect","life_fnc_spikestripeffect_meta","life_fnc_stopescorting","life_fnc_stopescorting_meta","life_fnc_storagebox","life_fnc_storagebox_meta","life_fnc_storevehicle","life_fnc_storevehicle_meta","life_fnc_storevehicleaction", - "life_fnc_storevehicleaction_meta","life_fnc_stripdownplayer","life_fnc_stripdownplayer_meta","life_fnc_surrender","life_fnc_surrender_meta","life_fnc_survival","life_fnc_survival_meta","life_fnc_tazed","life_fnc_tazed_meta","life_fnc_teleport","life_fnc_teleport_meta","life_fnc_ticketaction","life_fnc_ticketaction_meta","life_fnc_ticketgive", + "life_fnc_storevehicleaction_meta","life_fnc_startLoadout","life_fnc_startLoadout_meta","life_fnc_stripdownplayer","life_fnc_stripdownplayer_meta","life_fnc_surrender","life_fnc_surrender_meta","life_fnc_survival","life_fnc_survival_meta","life_fnc_tazed","life_fnc_tazed_meta","life_fnc_teleport","life_fnc_teleport_meta","life_fnc_ticketaction","life_fnc_ticketaction_meta","life_fnc_ticketgive", "life_fnc_ticketgive_meta","life_fnc_ticketpaid","life_fnc_ticketpaid_meta","life_fnc_ticketpay","life_fnc_ticketpay_meta","life_fnc_ticketprompt","life_fnc_ticketprompt_meta","life_fnc_unimpound","life_fnc_unimpound_meta","life_fnc_unrestrain","life_fnc_unrestrain_meta","life_fnc_updateviewdistance","life_fnc_updateviewdistance_meta","life_fnc_useitem","life_fnc_useitem_meta", "life_fnc_vehicleanimate","life_fnc_vehicleanimate_meta","life_fnc_vehiclecolor3drefresh","life_fnc_vehiclecolor3drefresh_meta","life_fnc_vehiclecolorcfg","life_fnc_vehiclecolorcfg_meta","life_fnc_vehiclecolorstr","life_fnc_vehiclecolorstr_meta","life_fnc_vehiclegarage","life_fnc_vehiclegarage_meta","life_fnc_vehiclelistcfg","life_fnc_vehiclelistcfg_meta","life_fnc_vehicleowners", "life_fnc_vehicleowners_meta","life_fnc_3dpreviewdisplay","life_fnc_3dpreviewdisplay_meta","life_fnc_vehicleshopbuy","life_fnc_vehicleshopbuy_meta","life_fnc_3dpreviewexit","life_fnc_3dpreviewexit_meta","life_fnc_3dpreviewinit","life_fnc_3dpreviewinit_meta","life_fnc_vehicleshoplbchange","life_fnc_vehicleshoplbchange_meta", diff --git a/Altis_Life.Altis/core/actions/fn_stopEscorting.sqf b/Altis_Life.Altis/core/actions/fn_stopEscorting.sqf index 8a1e0baf0..791ef14d8 100644 --- a/Altis_Life.Altis/core/actions/fn_stopEscorting.sqf +++ b/Altis_Life.Altis/core/actions/fn_stopEscorting.sqf @@ -13,5 +13,4 @@ if (isNull _unit) exitWith {}; //Target not found even after using cursorTarget. if (!(_unit getVariable ["Escorting",false])) exitWith {}; //He's not being Escorted. detach _unit; _unit setVariable ["Escorting",false,true]; -player setVariable ["currentlyEscorting",nil]; player setVariable ["isEscorting",false]; diff --git a/Altis_Life.Altis/core/civilian/fn_civLoadout.sqf b/Altis_Life.Altis/core/civilian/fn_civLoadout.sqf deleted file mode 100644 index 058286b0e..000000000 --- a/Altis_Life.Altis/core/civilian/fn_civLoadout.sqf +++ /dev/null @@ -1,21 +0,0 @@ -/* - File: fn_civLoadout.sqf - Author: Tobias 'Xetoxyc' Sittenauer - - Description: - Loads the civs out with the default gear, with randomized clothing. -*/ -private ["_handle"]; -_handle = [] spawn life_fnc_stripDownPlayer; -waitUntil {scriptDone _handle}; - -_clothings = ["U_C_Poloshirt_blue","U_C_Poloshirt_burgundy","U_C_Poloshirt_stripped","U_C_Poloshirt_tricolour","U_C_Poloshirt_salmon","U_C_Poloshirt_redwhite","U_C_Commoner1_1"]; -player addUniform (selectRandom _clothings); - -/* ITEMS */ -player linkItem "ItemMap"; -player linkItem "ItemCompass"; -player linkItem "ItemWatch"; - -[] call life_fnc_playerSkins; -[] call life_fnc_saveGear; diff --git a/Altis_Life.Altis/core/cop/fn_copLights.sqf b/Altis_Life.Altis/core/cop/fn_copLights.sqf index 936bb7498..3cb313452 100644 --- a/Altis_Life.Altis/core/cop/fn_copLights.sqf +++ b/Altis_Life.Altis/core/cop/fn_copLights.sqf @@ -22,36 +22,37 @@ _lightLeft setLightColor _lightRed; _lightLeft setLightBrightness 0.2; _lightLeft setLightAmbient [0.1,0.1,1]; -private _offset = switch (typeOf _vehicle) do { +//Format: [[left position], [right position]] +(switch (typeOf _vehicle) do { case "C_Offroad_01_F": { - [-0.37, 0.0, 0.56]; + [[-0.37, 0.0, 0.56], [0.37, 0.0, 0.56]]; }; case "B_MRAP_01_F": { - [-0.37, -1.9, 0.7]; + [[-0.37, -1.9, 0.7], [0.37, -1.9, 0.7]]; }; case "C_SUV_01_F": { - [-0.37,-1.2,0.42]; + [[-0.37,-1.2,0.42], [0.37,-1.2,0.42]]; }; case "C_Hatchback_01_sport_F": { - [-0.35,-0.2,0.25]; + [[-0.35,-0.2,0.25], [0.35,-0.2,0.25]]; }; case "B_Heli_Light_01_F": { - [-0.37, 0.0, -0.80]; + [[-0.37, 0.0, -0.80], [0.37, 0.0, -0.80]]; }; case "B_Heli_Transport_01_F": { - [-0.5, 0.0, 0.81]; + [[-0.5, 0.0, 0.81], [0.5, 0.0, 0.81]]; }; default { - [-1]; + [[-1], [-1]]; }; -}; +}) params ["_leftOffset", "_rightOffset"]; -if (_offset isEqualTo [-1]) exitWith { - diag_log format ["Vehicle emergency lights not set for: %1",_vehicle]; +if (_leftOffset isEqualTo [-1]) exitWith { + diag_log format ["Vehicle emergency lights not set for: %1", _vehicle]; hint localize "STR_NOTF_ELSNotSet"; }; -_lightLeft lightAttachObject [_vehicle, _offset]; +_lightLeft lightAttachObject [_vehicle, _leftOffset]; _lightLeft setLightAttenuation [0.181, 0, 1000, 130]; _lightLeft setLightIntensity 10; @@ -65,28 +66,7 @@ _lightRight setLightColor _lightBlue; _lightRight setLightBrightness 0.2; _lightRight setLightAmbient [0.1,0.1,1]; -_offset = switch (typeOf _vehicle) do { - case "C_Offroad_01_F": { - [0.37, 0.0, 0.56]; - }; - case "B_MRAP_01_F": { - [0.37, -1.9, 0.7]; - }; - case "C_SUV_01_F": { - [0.37,-1.2,0.42]; - }; - case "C_Hatchback_01_sport_F": { - [0.35,-0.2,0.25]; - }; - case "B_Heli_Light_01_F": { - [0.37, 0.0, -0.80]; - }; - case "B_Heli_Transport_01_F": { - [0.5, 0.0, 0.81]; - }; -}; - -_lightRight lightAttachObject [_vehicle, _offset]; +_lightRight lightAttachObject [_vehicle, _rightOffset]; _lightRight setLightAttenuation [0.181, 0, 1000, 130]; _lightRight setLightIntensity 10; diff --git a/Altis_Life.Altis/core/cop/fn_copLoadout.sqf b/Altis_Life.Altis/core/cop/fn_copLoadout.sqf deleted file mode 100644 index 58411e7da..000000000 --- a/Altis_Life.Altis/core/cop/fn_copLoadout.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/* - File: fn_copLoadout.sqf - Author: Bryan "Tonic" Boardwine - Edited: Itsyuka - - Description: - Loads the cops out with the default gear. -*/ -private ["_handle"]; -_handle = [] spawn life_fnc_stripDownPlayer; -waitUntil {scriptDone _handle}; - -//Load player with default cop gear. -player addUniform "U_Rangemaster"; -player addVest "V_Rangemaster_belt"; - -player addMagazine "16Rnd_9x21_Mag"; -player addWeapon "hgun_P07_snds_F"; -player addMagazine "16Rnd_9x21_Mag"; -player addMagazine "16Rnd_9x21_Mag"; -player addMagazine "16Rnd_9x21_Mag"; -player addMagazine "16Rnd_9x21_Mag"; -player addMagazine "16Rnd_9x21_Mag"; - -/* ITEMS */ -player linkItem "ItemMap"; -player linkItem "ItemCompass"; -player linkItem "ItemWatch"; -player linkItem "ItemGPS"; - -[] call life_fnc_playerSkins; -[] call life_fnc_saveGear; diff --git a/Altis_Life.Altis/core/fn_initCiv.sqf b/Altis_Life.Altis/core/fn_initCiv.sqf index e81fab005..fa922a0ee 100644 --- a/Altis_Life.Altis/core/fn_initCiv.sqf +++ b/Altis_Life.Altis/core/fn_initCiv.sqf @@ -22,8 +22,7 @@ if (life_is_alive && !life_is_arrested) then { } else { if (!life_is_alive && !life_is_arrested) then { if (LIFE_SETTINGS(getNumber,"save_civilian_positionStrict") isEqualTo 1) then { - _handle = [] spawn life_fnc_civLoadout; - waitUntil {scriptDone _handle}; + [] call life_fnc_startLoadout; CASH = 0; [0] call SOCK_fnc_updatePartial; }; diff --git a/Altis_Life.Altis/core/functions/fn_loadGear.sqf b/Altis_Life.Altis/core/functions/fn_loadGear.sqf index d7cdeb9d2..3d32b7cbc 100644 --- a/Altis_Life.Altis/core/functions/fn_loadGear.sqf +++ b/Altis_Life.Altis/core/functions/fn_loadGear.sqf @@ -6,28 +6,12 @@ Description: Loads saved civilian gear, this is limited for a reason and that's balance. */ -private ["_itemArray","_handle"]; -_itemArray = life_gear; +private _itemArray = life_gear; waitUntil {!(isNull (findDisplay 46))}; -_handle = [] spawn life_fnc_stripDownPlayer; -waitUntil {scriptDone _handle}; +[] call life_fnc_stripDownPlayer; -if (count _itemArray isEqualTo 0) exitWith { - switch (playerSide) do { - case west: { - [] call life_fnc_copLoadout; - }; - - case civilian: { - [] call life_fnc_civLoadout; - }; - - case independent: { - [] call life_fnc_medicLoadout; - }; - }; -}; +if (_itemArray isEqualTo []) exitWith {[] call life_fnc_startLoadout;}; _itemArray params [ "_uniform", @@ -49,6 +33,7 @@ _itemArray params [ ["_yItems",[]] ]; +private "_handle"; if (!(_goggles isEqualTo "")) then {_handle = [_goggles,true,false,false,false] spawn life_fnc_handleItem; waitUntil {scriptDone _handle};}; if (!(_headgear isEqualTo "")) then {_handle = [_headgear,true,false,false,false] spawn life_fnc_handleItem; waitUntil {scriptDone _handle};}; if (!(_uniform isEqualTo "")) then {_handle = [_uniform,true,false,false,false] spawn life_fnc_handleItem; waitUntil {scriptDone _handle};}; diff --git a/Altis_Life.Altis/core/functions/fn_startLoadout.sqf b/Altis_Life.Altis/core/functions/fn_startLoadout.sqf new file mode 100755 index 000000000..3ad8859c0 --- /dev/null +++ b/Altis_Life.Altis/core/functions/fn_startLoadout.sqf @@ -0,0 +1,81 @@ +#include "..\..\script_macros.hpp" +/* + File: fn_startLoadout.sqf + Author: Casperento + + Description: + Loads a custom loadout on player when he got a new life +*/ +private _pUniform = M_CONFIG(getArray,"Loadouts",str(playerSide),"uniform"); +private _pVest = M_CONFIG(getArray,"Loadouts",str(playerSide),"vest"); +private _pBackpack = M_CONFIG(getArray,"Loadouts",str(playerSide),"backpack"); +private _pWeapon = M_CONFIG(getArray,"Loadouts",str(playerSide),"weapon"); +private _pMagazines = M_CONFIG(getArray,"Loadouts",str(playerSide),"mags"); +private _pItems = M_CONFIG(getArray,"Loadouts",str(playerSide),"items"); +private _linkedItems = M_CONFIG(getArray,"Loadouts",str(playerSide),"linkedItems"); + +if !(_pUniform isEqualTo []) then { + if (playerSide isEqualTo civilian) then { + _pUniform = selectRandom _pUniform; + if (!(_pUniform isEqualTo []) && {!((_pUniform select 0) isEqualTo "") && {([(_pUniform select 1)] call life_fnc_levelCheck)}}) then { + player addUniform (_pUniform select 0); + }; + } else { + _pUniform apply { + if (!(_x isEqualTo []) && {!((_x select 0) isEqualTo "") && {([(_x select 1)] call life_fnc_levelCheck)}}) then { + player addUniform (_x select 0); + }; + }; + }; +}; + +if !(_pVest isEqualTo []) then { + _pVest apply { + if (!(_x isEqualTo []) && {!((_x select 0) isEqualTo "") && {([(_x select 1)] call life_fnc_levelCheck)}}) then { + player addVest (_x select 0); + }; + }; +}; + +if !(_pBackpack isEqualTo []) then { + _pBackpack apply { + if (!(_x isEqualTo []) && {!((_x select 0) isEqualTo "") && {([(_x select 1)] call life_fnc_levelCheck)}}) then { + player addBackpack (_x select 0); + }; + }; +}; + +if !(_pWeapon isEqualTo []) then { + _pWeapon apply { + if (!(_x isEqualTo []) && {!((_x select 0) isEqualTo "") && {([(_x select 1)] call life_fnc_levelCheck)}}) then { + player addWeapon (_x select 0); + }; + }; +}; + +if !(_pMagazines isEqualTo []) then { + _pMagazines apply { + if (!(_x isEqualTo []) && {!((_x select 0) isEqualTo "") && {((_x select 1) > 0) && {([(_x select 2)] call life_fnc_levelCheck)}}}) then { + player addMagazines [(_x select 0),(_x select 1)]; + }; + }; +}; + +if !(_pItems isEqualTo []) then { + _pItems apply { + if (!(_x isEqualTo []) && {!((_x select 0) isEqualTo "") && {((_x select 1) > 0) && {([(_x select 2)] call life_fnc_levelCheck)}}}) then { + for "_i" from 1 to (_x select 1) step 1 do {player addItem (_x select 0)}; + }; + }; +}; + +if !(_linkedItems isEqualTo []) then { + _linkedItems apply { + if (!(_x isEqualTo []) && {!((_x select 0) isEqualTo "") && {([(_x select 1)] call life_fnc_levelCheck)}}) then { + player linkItem (_x select 0); + }; + }; +}; + +[] call life_fnc_playerSkins; +[] call life_fnc_saveGear; diff --git a/Altis_Life.Altis/core/medical/fn_medicLights.sqf b/Altis_Life.Altis/core/medical/fn_medicLights.sqf index aff17f383..99edeb578 100644 --- a/Altis_Life.Altis/core/medical/fn_medicLights.sqf +++ b/Altis_Life.Altis/core/medical/fn_medicLights.sqf @@ -22,21 +22,23 @@ _lightLeft setLightColor _lightRed; _lightLeft setLightBrightness 0.2; _lightLeft setLightAmbient [0.1,0.1,1]; -private _offset = switch (typeOf _vehicle) do { + +//Format: [[left position], [right position]] +(switch (typeOf _vehicle) do { case "C_Offroad_01_F": { - [-0.37, 0.0, 0.56]; + [[-0.37, 0.0, 0.56], [0.37, 0.0, 0.56]]; }; default { - [-1]; + [[-1], [-1]]; }; -}; +}) params ["_leftOffset", "_rightOffset"]; -if (_offset isEqualTo [-1]) exitWith { +if (_leftOffset isEqualTo [-1]) exitWith { diag_log format ["Vehicle emergency lights not set for: %1",_vehicle]; hint localize "STR_NOTF_ELSNotSet"; }; -_lightLeft lightAttachObject [_vehicle, _offset]; +_lightLeft lightAttachObject [_vehicle, _leftOffset]; _lightLeft setLightAttenuation [0.181, 0, 1000, 130]; _lightLeft setLightIntensity 10; @@ -50,13 +52,7 @@ _lightRight setLightColor _lightBlue; _lightRight setLightBrightness 0.2; _lightRight setLightAmbient [0.1,0.1,1]; -_offset = switch (typeOf _vehicle) do { - case "C_Offroad_01_F": { - [0.37, 0.0, 0.56]; - }; -}; - -_lightRight lightAttachObject [_vehicle, _offset]; +_lightRight lightAttachObject [_vehicle, _rightOffset]; _lightRight setLightAttenuation [0.181, 0, 1000, 130]; _lightRight setLightIntensity 10; diff --git a/Altis_Life.Altis/core/medical/fn_medicLoadout.sqf b/Altis_Life.Altis/core/medical/fn_medicLoadout.sqf deleted file mode 100644 index 958d64b1e..000000000 --- a/Altis_Life.Altis/core/medical/fn_medicLoadout.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "..\..\script_macros.hpp" -/* - File: fn_medicLoadout.sqf - Author: Bryan "Tonic" Boardwine - - Description: - Loads the medic out with the default gear. -*/ -private ["_handle"]; -_handle = [] spawn life_fnc_stripDownPlayer; -waitUntil {scriptDone _handle}; - -player addUniform "U_Rangemaster"; -player addItem "FirstAidKit"; -player addItem "FirstAidKit"; -player linkItem "ItemMap"; -player linkItem "ItemCompass"; -player linkItem "ItemWatch"; - -[] call life_fnc_playerSkins; -[] call life_fnc_saveGear; diff --git a/Altis_Life.Altis/core/medical/fn_onPlayerKilled.sqf b/Altis_Life.Altis/core/medical/fn_onPlayerKilled.sqf index 78c5bbc7f..49e8d0c45 100644 --- a/Altis_Life.Altis/core/medical/fn_onPlayerKilled.sqf +++ b/Altis_Life.Altis/core/medical/fn_onPlayerKilled.sqf @@ -57,18 +57,19 @@ _unit spawn { _maxTime = time + LIFE_SETTINGS(getNumber,"respawn_timer"); }; _RespawnBtn ctrlEnable false; - waitUntil {_Timer ctrlSetText format [localize "STR_Medic_Respawn",[(_maxTime - time),"MM:SS"] call BIS_fnc_secondsToString]; - round(_maxTime - time) <= 0 || isNull _this}; + waitUntil { + _Timer ctrlSetText format [localize "STR_Medic_Respawn",[(_maxTime - time),"MM:SS"] call BIS_fnc_secondsToString]; + round(_maxTime - time) <= 0 || isNull _this + }; _RespawnBtn ctrlEnable true; _Timer ctrlSetText localize "STR_Medic_Respawn_2"; }; _unit spawn { - private ["_requestBtn","_requestTime"]; disableSerialization; - _requestBtn = ((findDisplay 7300) displayCtrl 7303); + private _requestBtn = ((findDisplay 7300) displayCtrl 7303); _requestBtn ctrlEnable false; - _requestTime = time + 5; + private _requestTime = time + 5; waitUntil {round(_requestTime - time) <= 0 || isNull _this}; _requestBtn ctrlEnable true; }; @@ -77,9 +78,13 @@ _unit spawn { //Create a thread to follow with some what precision view of the corpse. [_unit] spawn { - private ["_unit"]; - _unit = _this select 0; - waitUntil {if (speed _unit isEqualTo 0) exitWith {true}; life_deathCamera camSetTarget _unit; life_deathCamera camSetRelPos [0,3.5,4.5]; life_deathCamera camCommit 0;}; + private _unit = _this select 0; + waitUntil { + life_deathCamera camSetTarget _unit; + life_deathCamera camSetRelPos [0,3.5,4.5]; + life_deathCamera camCommit 0; + speed _unit isEqualTo 0 + }; }; //Make the killer wanted @@ -146,4 +151,4 @@ life_is_alive = false; [3] call SOCK_fnc_updatePartial; if (playerSide isEqualTo civilian) then { [4] call SOCK_fnc_updatePartial; -}; \ No newline at end of file +}; diff --git a/Altis_Life.Altis/core/medical/fn_respawned.sqf b/Altis_Life.Altis/core/medical/fn_respawned.sqf index b771b9257..425db871d 100644 --- a/Altis_Life.Altis/core/medical/fn_respawned.sqf +++ b/Altis_Life.Altis/core/medical/fn_respawned.sqf @@ -25,20 +25,7 @@ player setVariable ["Revive",nil,true]; player setVariable ["name",nil,true]; player setVariable ["Reviving",nil,true]; -//Load gear for a 'new life' -switch (playerSide) do -{ - case west: { - _handle = [] spawn life_fnc_copLoadout; - }; - case civilian: { - _handle = [] spawn life_fnc_civLoadout; - }; - case independent: { - _handle = [] spawn life_fnc_medicLoadout; - }; - waitUntil {scriptDone _handle}; -}; +[] call life_fnc_startLoadout; //Cleanup of weapon containers near the body & hide it. if (!isNull life_corpse) then { diff --git a/Altis_Life.Altis/core/pmenu/fn_useItem.sqf b/Altis_Life.Altis/core/pmenu/fn_useItem.sqf index f869b7296..a5872ed3e 100644 --- a/Altis_Life.Altis/core/pmenu/fn_useItem.sqf +++ b/Altis_Life.Altis/core/pmenu/fn_useItem.sqf @@ -6,20 +6,31 @@ Description: Main function for item effects and functionality through the player menu. */ -private "_item"; disableSerialization; if ((lbCurSel 2005) isEqualTo -1) exitWith {hint localize "STR_ISTR_SelectItemFirst";}; -_item = CONTROL_DATA(2005); +private _item = CONTROL_DATA(2005); +private _edible = M_CONFIG(getNumber, "VirtualItems", _item, "edible"); + +if !(_edible isEqualTo -1) exitWith { + if ([false, _item, 1] call life_fnc_handleInv) then { + private _sum = life_hunger + _edible; + + life_hunger = (_sum max 5) min 100; //never below 5 or above 100 + + [] call life_fnc_p_updateMenu; + [] call life_fnc_hudUpdate; + }; +}; switch (true) do { - case (_item in ["waterBottle","coffee","redgull"]): { - if ([false,_item,1] call life_fnc_handleInv) then { + case (_item in ["waterBottle", "coffee", "redgull"]): { + if ([false, _item, 1] call life_fnc_handleInv) then { life_thirst = 100; - if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 0;}; - if (_item isEqualTo "redgull" && {LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1}) then { + if (LIFE_SETTINGS(getNumber, "enable_fatigue") isEqualTo 1) then {player setFatigue 0;}; + if (_item isEqualTo "redgull" && {LIFE_SETTINGS(getNumber, "enable_fatigue") isEqualTo 1}) then { [] spawn { life_redgull_effect = time; - titleText[localize "STR_ISTR_RedGullEffect","PLAIN"]; + titleText[localize "STR_ISTR_RedGullEffect", "PLAIN"]; player enableFatigue false; waitUntil {!alive player || ((time - life_redgull_effect) > (3 * 60))}; player enableFatigue true; @@ -55,7 +66,7 @@ switch (true) do { case (_item isEqualTo "spikeStrip"): { if (!isNull life_spikestrip) exitWith {hint localize "STR_ISTR_SpikesDeployment"; closeDialog 0}; - if ([false,_item,1] call life_fnc_handleInv) then { + if ([false, _item, 1] call life_fnc_handleInv) then { [] spawn life_fnc_spikeStrip; closeDialog 0; }; @@ -77,24 +88,10 @@ switch (true) do { closeDialog 0; }; - case (_item in ["apple","rabbit","salema","ornate","mackerel","tuna","mullet","catshark","turtle_soup","hen","rooster","sheep","goat","donuts","tbacon","peach"]): { - if (!(M_CONFIG(getNumber,"VirtualItems",_item,"edible") isEqualTo -1)) then { - if ([false,_item,1] call life_fnc_handleInv) then { - _val = M_CONFIG(getNumber,"VirtualItems",_item,"edible"); - _sum = life_hunger + _val; - switch (true) do { - case (_val < 0 && _sum < 1): {life_hunger = 5;}; //This adds the ability to set the entry edible to a negative value and decrease the hunger without death - case (_sum > 100): {life_hunger = 100;}; - default {life_hunger = _sum;}; - }; - }; - }; - }; - default { hint localize "STR_ISTR_NotUsable"; }; }; [] call life_fnc_p_updateMenu; -[] call life_fnc_hudUpdate; \ No newline at end of file +[] call life_fnc_hudUpdate; diff --git a/Altis_Life.Altis/core/shops/fn_chopShopMenu.sqf b/Altis_Life.Altis/core/shops/fn_chopShopMenu.sqf index f475ea79f..f37afaf2b 100644 --- a/Altis_Life.Altis/core/shops/fn_chopShopMenu.sqf +++ b/Altis_Life.Altis/core/shops/fn_chopShopMenu.sqf @@ -6,40 +6,45 @@ Description: Opens & initializes the chop shop menu. */ -private ["_control","_price","_nearVehicles","_chopMultiplier","_chopable","_nearUnits"]; if (life_action_inUse) exitWith {hint localize "STR_NOTF_ActionInProc"}; if !(playerSide isEqualTo civilian) exitWith {hint localize "STR_NOTF_notAllowed"}; + disableSerialization; -_chopable = LIFE_SETTINGS(getArray,"chopShop_vehicles"); -_nearVehicles = nearestObjects [getMarkerPos (_this select 3),_chopable,25]; -_nearUnits = (nearestObjects[player,["CAManBase"],5]) arrayIntersect playableUnits; + +private _chopable = LIFE_SETTINGS(getArray,"chopShop_vehicles"); +private _nearVehicles = nearestObjects [getMarkerPos (_this select 3),_chopable,25]; +private _nearUnits = (nearestObjects[player,["CAManBase"],5]) arrayIntersect playableUnits; if (count _nearUnits > 1) exitWith {hint localize "STR_NOTF_PlayerNear"}; life_chopShop = _this select 3; //Error check -if (count _nearVehicles isEqualTo 0) exitWith {titleText[localize "STR_Shop_NoVehNear","PLAIN"];}; +if (_nearVehicles isEqualTo []) exitWith {titleText[localize "STR_Shop_NoVehNear","PLAIN"];}; if (!(createDialog "Chop_Shop")) exitWith {hint localize "STR_Shop_ChopShopError"}; -_control = CONTROL(39400,39402); +private _control = CONTROL(39400,39402); +private "_className"; +private "_displayName"; +private "_picture"; +private "_price"; +private "_chopMultiplier"; { if (alive _x) then { _className = typeOf _x; - _classNameLife = _className; _displayName = getText(configFile >> "CfgVehicles" >> _className >> "displayName"); _picture = getText(configFile >> "CfgVehicles" >> _className >> "picture"); - if (!isClass (missionConfigFile >> "LifeCfgVehicles" >> _classNameLife)) then { - _classNameLife = "Default"; //Use Default class if it doesn't exist + if (!isClass (missionConfigFile >> "LifeCfgVehicles" >> _className)) then { diag_log format ["%1: LifeCfgVehicles class doesn't exist",_className]; + _className = "Default"; //Use Default class if it doesn't exist }; - _price = M_CONFIG(getNumber,"LifeCfgVehicles",_classNameLife,"price"); + _price = M_CONFIG(getNumber,"LifeCfgVehicles",_className,"price"); _chopMultiplier = LIFE_SETTINGS(getNumber,"vehicle_chopShop_multiplier"); _price = _price * _chopMultiplier; if (!isNil "_price" && count crew _x isEqualTo 0) then { _control lbAdd _displayName; - _control lbSetData [(lbSize _control)-1,str(_forEachIndex)]; + _control lbSetData [(lbSize _control)-1,(netId _x)]; _control lbSetPicture [(lbSize _control)-1,_picture]; _control lbSetValue [(lbSize _control)-1,_price]; }; diff --git a/Altis_Life.Altis/core/shops/fn_chopShopSelection.sqf b/Altis_Life.Altis/core/shops/fn_chopShopSelection.sqf index f29dc823b..49613ba15 100644 --- a/Altis_Life.Altis/core/shops/fn_chopShopSelection.sqf +++ b/Altis_Life.Altis/core/shops/fn_chopShopSelection.sqf @@ -5,15 +5,15 @@ Description: Displays the pricing for the currently selected vehicle. */ -disableSerialization; -private ["_control","_selection","_price","_priceTag"]; -_control = [_this,0,controlNull,[controlNull]] call BIS_fnc_param; -_selection = [_this,1,-1,[0]] call BIS_fnc_param; +params [ + ["_control",controlNull,[controlNull]], + ["_selection",-1,[0]] +]; //Error checks if (isNull _control || _selection isEqualTo -1) exitWith {}; -_price = _control lbValue _selection; +private _price = _control lbValue _selection; -_priceTag = ((findDisplay 39400) displayCtrl 39401); +private _priceTag = ((findDisplay 39400) displayCtrl 39401); _priceTag ctrlSetStructuredText parseText format ["" +(localize "STR_GNOTF_Price")+ "$%1",[(_price)] call life_fnc_numberText]; \ No newline at end of file diff --git a/Altis_Life.Altis/core/shops/fn_chopShopSell.sqf b/Altis_Life.Altis/core/shops/fn_chopShopSell.sqf index 62876b825..f3316b82c 100644 --- a/Altis_Life.Altis/core/shops/fn_chopShopSell.sqf +++ b/Altis_Life.Altis/core/shops/fn_chopShopSell.sqf @@ -7,25 +7,19 @@ Sells the selected vehicle off. */ disableSerialization; -private ["_control","_price","_vehicle","_nearVehicles","_price2","_chopable"]; -_control = CONTROL(39400,39402); -_price = _control lbValue (lbCurSel _control); -_vehicle = _control lbData (lbCurSel _control); -_vehicle = call compile format ["%1", _vehicle]; -_chopable = LIFE_SETTINGS(getArray,"chopShop_vehicles"); -_nearVehicles = nearestObjects [getMarkerPos life_chopShop,_chopable,25]; -_vehicle = (_nearVehicles select _vehicle); + +private _control = CONTROL(39400,39402); +private _price = _control lbValue (lbCurSel _control); +private _vehicle = objectFromNetId (_control lbData (lbCurSel _control)); if (isNull _vehicle) exitWith {}; -hint localize "STR_Shop_ChopShopSelling"; +systemChat localize "STR_Shop_ChopShopSelling"; life_action_inUse = true; -_price2 = CASH + _price; -[0] call SOCK_fnc_updatePartial; if (life_HC_isActive) then { - [player,_vehicle,_price,_price2] remoteExecCall ["HC_fnc_chopShopSell",HC_Life]; + [player,_vehicle,_price] remoteExecCall ["HC_fnc_chopShopSell",HC_Life]; } else { - [player,_vehicle,_price,_price2] remoteExecCall ["TON_fnc_chopShopSell",RSERV]; + [player,_vehicle,_price] remoteExecCall ["TON_fnc_chopShopSell",RSERV]; }; if (LIFE_SETTINGS(getNumber,"player_advancedLog") isEqualTo 1) then { diff --git a/Altis_Life.Altis/core/shops/fn_chopShopSold.sqf b/Altis_Life.Altis/core/shops/fn_chopShopSold.sqf new file mode 100644 index 000000000..ae1aff77d --- /dev/null +++ b/Altis_Life.Altis/core/shops/fn_chopShopSold.sqf @@ -0,0 +1,20 @@ +#include "..\..\script_macros.hpp" +/* + File: fn_chopShopSold.sqf + Author: Casperento + + Description: + Finish chopshop sell process properly +*/ +params [ + ["_price",-1,[-1]], + ["_displayName","",[""]] +]; + +life_action_inUse = false; + +if (_price > 0) then { + CASH = CASH + _price; + [0] call SOCK_fnc_updatePartial; + titleText [format[(localize "STR_NOTF_ChopSoldCar"),_displayName,[_price] call life_fnc_numberText],"PLAIN",1]; +}; \ No newline at end of file diff --git a/Altis_Life.Altis/core/shops/fn_vehicleShopBuy.sqf b/Altis_Life.Altis/core/shops/fn_vehicleShopBuy.sqf index d4ea687ba..dbd66fcb9 100644 --- a/Altis_Life.Altis/core/shops/fn_vehicleShopBuy.sqf +++ b/Altis_Life.Altis/core/shops/fn_vehicleShopBuy.sqf @@ -82,7 +82,11 @@ if ((life_veh_shop select 0) == "med_air_hs") then { if (_spawnPoint isEqualTo "") exitWith {hint localize "STR_Shop_Veh_Block"; closeDialog 0;}; CASH = CASH - _purchasePrice; [0] call SOCK_fnc_updatePartial; -hint format [localize "STR_Shop_Veh_Bought",getText(configFile >> "CfgVehicles" >> _className >> "displayName"),[_purchasePrice] call life_fnc_numberText]; +if (_mode) then { + hint format [localize "STR_Shop_Veh_Bought",getText(configFile >> "CfgVehicles" >> _className >> "displayName"),[_purchasePrice] call life_fnc_numberText]; +} else { + hint format [localize "STR_Shop_Veh_Rented",getText(configFile >> "CfgVehicles" >> _className >> "displayName"),[_purchasePrice] call life_fnc_numberText]; +}; //Spawn the vehicle and prep it. diff --git a/Altis_Life.Altis/description.ext b/Altis_Life.Altis/description.ext index 78084072e..12247aa2d 100644 --- a/Altis_Life.Altis/description.ext +++ b/Altis_Life.Altis/description.ext @@ -1,5 +1,6 @@ disableChannels[] = {{0,true,true},{1,true,true},{2,true,true}}; // Disabled text and voice for global, side, and command channels. Syntax: disableChannels[] = {{channelID, disableChat, disableVoice}}; overviewText = "$STR_MISC_overviewText"; // Text to be displayed below the overviewPicture on the mission selection screen when the mission is available to play. +unsafeCVL = 1; // Allows createVehicleLocal to be executed in Multiplayer #include "config\Config_SpyGlass.hpp" #include "CfgRemoteExec.hpp" diff --git a/Altis_Life.Altis/stringtable.xml b/Altis_Life.Altis/stringtable.xml index e385d1d0e..e5795e5b1 100644 --- a/Altis_Life.Altis/stringtable.xml +++ b/Altis_Life.Altis/stringtable.xml @@ -9847,6 +9847,18 @@ Você comprou %1 por R$%2 Kupiłeś %1 za $%2 你买了一个 %1 花费 $%2 + + + You rented a %1 for $%2 + Pronajali jste si %1 za $%2 + Alquiló un %1 por $%2 + Вы арендовали %1 за $%2 + Sie haben %1 für $%2 gemietet + Vous avez loué un %1 pour $%2 + Hai noleggiato un %1 per $%2 + Você alugou um %1 por $%2 + Wypożyczyłeś %1 za $%2 + 您以 $%2 的价格租了一个 %1 Rental Price: @@ -13379,4 +13391,4 @@ %1 - %2 将 $%3 存进他们的银行账户。银行存款余额:$%4 手上现金:$%5 - + \ No newline at end of file diff --git a/BEFilters/setvariable.txt b/BEFilters/setvariable.txt index 9ccdb5a48..add9a4edd 100644 --- a/BEFilters/setvariable.txt +++ b/BEFilters/setvariable.txt @@ -1,3 +1,3 @@ //regex 1 "" -5 "" !bis_disabled_Door_[1-6] !=BIS_fnc_(selectRespawnTemplate_respawned|setVehicleMass) !=chargeplaced !container_(id|owner) !=containers !=currentlyEscorting !=dbInfo !=Escorting !=escortingPlayer !fuelTank(Work)? !gang_(bank|id|maxMembers|members|name|owner) !=gangOwner !=gbank_in_use_by !house_(id|owned|owner|sold) !houses_.+ !=inCapture !=inUse !=isEscorting !=item !life_(clientID|VEH_color) !=color !=lights !=lightSource !=locked !=mining !(real)?name !=NPC !=playerSurrender !=rank !=restrained !=Revive !=Reviving !=robbed !safe(_open)? !=sellers !=siren !=slots !=spikeDeployed !=steam64id !=transporting !Trunk(_in_use(_by)?)? !=uid !=vehicle_info_owners !="(true|false) [\d]:[\d]+ (C_man_1|B_RangeMaster_F)" !=#var !=saved3deninventory +5 "" !bis_disabled_Door_[1-6] !=BIS_fnc_(selectRespawnTemplate_respawned|setVehicleMass) !=chargeplaced !container_(id|owner) !=containers !=dbInfo !=Escorting !=escortingPlayer !fuelTank(Work)? !gang_(bank|id|maxMembers|members|name|owner) !=gangOwner !=gbank_in_use_by !house_(id|owned|owner|sold) !houses_.+ !=inCapture !=inUse !=isEscorting !=item !life_(clientID|VEH_color) !=color !=lights !=lightSource !=locked !=mining !(real)?name !=NPC !=playerSurrender !=rank !=restrained !=Revive !=Reviving !=robbed !safe(_open)? !=sellers !=siren !=slots !=spikeDeployed !=steam64id !=transporting !Trunk(_in_use(_by)?)? !=uid !=vehicle_info_owners !="(true|false) [\d]:[\d]+ (C_man_1|B_RangeMaster_F)" !=#var !=saved3deninventory diff --git a/altislife.sql b/altislife.sql old mode 100755 new mode 100644 diff --git a/life_hc/MySQL/Vehicles/fn_chopShopSell.sqf b/life_hc/MySQL/Vehicles/fn_chopShopSell.sqf index 7a466c7ec..a47da9473 100644 --- a/life_hc/MySQL/Vehicles/fn_chopShopSell.sqf +++ b/life_hc/MySQL/Vehicles/fn_chopShopSell.sqf @@ -8,35 +8,26 @@ Description: Checks whether or not the vehicle is persistent or temp and sells it. */ -private ["_unit","_vehicle","_price","_cash","_ownerUnit"]; -_unit = [_this,0,objNull,[objNull]] call BIS_fnc_param; -_vehicle = [_this,1,objNull,[objNull]] call BIS_fnc_param; -_price = [_this,2,500,[0]] call BIS_fnc_param; -_cash = [_this,3,0,[0]] call BIS_fnc_param; - -_ownerUnit = _unit getVariable "life_clientID"; +params [ + ["_unit",objNull,[objNull]], + ["_vehicle",objNull,[objNull]], + ["_price",500,[0]] +]; //Error checks if (isNull _vehicle || isNull _unit) exitWith { - life_action_inUse = false; - _ownerUnit publicVariableClient "life_action_inUse"; + [] remoteExecCall ["life_fnc_chopShopSold", remoteExecutedOwner]; }; -_displayName = FETCH_CONFIG2(getText,"CfgVehicles",typeOf _vehicle, "displayName"); +private _displayName = FETCH_CONFIG2(getText,"CfgVehicles",typeOf _vehicle, "displayName"); -_dbInfo = _vehicle getVariable ["dbInfo",[]]; +private _dbInfo = _vehicle getVariable ["dbInfo",[]]; if (count _dbInfo > 0) then { - _uid = (_dbInfo select 0); - _plate = (_dbInfo select 1); - - _query = format ["UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'",_uid,_plate]; - - _sql = [_query,1] call HC_fnc_asyncCall; + _dbInfo params ["_uid","_plate"]; + private _query = format ["UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'",_uid,_plate]; + [_query,1] call HC_fnc_asyncCall; }; deleteVehicle _vehicle; -life_action_inUse = false; -_ownerUnit publicVariableClient "life_action_inUse"; -CASH = _cash; -_ownerUnit publicVariableClient "life_cash"; -[2,"STR_NOTF_ChopSoldCar",true,[_displayName,[_price] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",_unit]; \ No newline at end of file + +[_price,_displayName] remoteExecCall ["life_fnc_chopShopSold", remoteExecutedOwner]; \ No newline at end of file diff --git a/life_server/Functions/Systems/fn_chopShopSell.sqf b/life_server/Functions/Systems/fn_chopShopSell.sqf index bd55f8144..100f62901 100644 --- a/life_server/Functions/Systems/fn_chopShopSell.sqf +++ b/life_server/Functions/Systems/fn_chopShopSell.sqf @@ -6,34 +6,26 @@ Description: Checks whether or not the vehicle is persistent or temp and sells it. */ -private ["_unit","_vehicle","_price","_cash"]; -_unit = [_this,0,objNull,[objNull]] call BIS_fnc_param; -_vehicle = [_this,1,objNull,[objNull]] call BIS_fnc_param; -_price = [_this,2,500,[0]] call BIS_fnc_param; -_cash = [_this,3,0,[0]] call BIS_fnc_param; +params [ + ["_unit",objNull,[objNull]], + ["_vehicle",objNull,[objNull]], + ["_price",500,[0]] +]; //Error checks if (isNull _vehicle || isNull _unit) exitWith { - life_action_inUse = false; - owner _unit publicVariableClient "life_action_inUse"; + [] remoteExecCall ["life_fnc_chopShopSold", remoteExecutedOwner]; }; -_displayName = FETCH_CONFIG2(getText,"CfgVehicles",typeOf _vehicle, "displayName"); -_unit = owner _unit; +private _displayName = FETCH_CONFIG2(getText,"CfgVehicles",typeOf _vehicle, "displayName"); -_dbInfo = _vehicle getVariable ["dbInfo",[]]; +private _dbInfo = _vehicle getVariable ["dbInfo",[]]; if (count _dbInfo > 0) then { - _uid = (_dbInfo select 0); - _plate = (_dbInfo select 1); - - _query = format ["UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'",_uid,_plate]; - - _sql = [_query,1] call DB_fnc_asyncCall; + _dbInfo params ["_uid","_plate"]; + private _query = format ["UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'",_uid,_plate]; + [_query,1] call DB_fnc_asyncCall; }; deleteVehicle _vehicle; -life_action_inUse = false; -_unit publicVariableClient "life_action_inUse"; -CASH = _cash; -_unit publicVariableClient "life_cash"; -[2,"STR_NOTF_ChopSoldCar",true,[_displayName,[_price] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",_unit]; + +[_price,_displayName] remoteExecCall ["life_fnc_chopShopSold", remoteExecutedOwner]; \ No newline at end of file