initial commit

This commit is contained in:
Benjamin Kyd
2019-06-05 00:45:50 +01:00
commit c8014ec81e
610 changed files with 177002 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
#include "..\..\script_macros.hpp"
/*
File: fn_arrestAction.sqf
Author:
Description:
Arrests the targeted person.
*/
private ["_unit","_id"];
_unit = param [0,objNull,[objNull]];
if (isNull _unit) exitWith {}; //Not valid
if (isNil "_unit") exitWith {}; //Not Valid
if (!(_unit isKindOf "Man")) exitWith {}; //Not a unit
if (!isPlayer _unit) exitWith {}; //Not a human
if (!(_unit getVariable "restrained")) exitWith {}; //He's not restrained.
if (!((side _unit) in [civilian,independent])) exitWith {}; //Not a civ
if (isNull _unit) exitWith {}; //Not valid
if (life_HC_isActive) then {
[getPlayerUID _unit,_unit,player,false] remoteExecCall ["HC_fnc_wantedBounty",HC_Life];
} else {
[getPlayerUID _unit,_unit,player,false] remoteExecCall ["life_fnc_wantedBounty",RSERV];
};
if (isNull _unit) exitWith {}; //Not valid
detach _unit;
[_unit,false] remoteExecCall ["life_fnc_jail",_unit];
[0,"STR_NOTF_Arrested_1",true, [_unit getVariable ["realname",name _unit], profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
if (LIFE_SETTINGS(getNumber,"player_advancedLog") isEqualTo 1) then {
if (LIFE_SETTINGS(getNumber,"battlEye_friendlyLogging") isEqualTo 1) then {
advanced_log = format [localize "STR_DL_AL_Arrested_BEF",_unit getVariable ["realname",name _unit]];
} else {
advanced_log = format [localize "STR_DL_AL_Arrested",profileName,(getPlayerUID player),_unit getVariable ["realname",name _unit]];
};
publicVariableServer "advanced_log";
};

View File

@@ -0,0 +1,26 @@
#include "..\..\script_macros.hpp"
/*
File: fn_buyLicense.sqf
Author: Bryan "Tonic" Boardwine
Description:
Called when purchasing a license. May need to be revised.
*/
private ["_type","_varName","_displayName","_sideFlag","_price"];
_type = _this select 3;
if (!isClass (missionConfigFile >> "Licenses" >> _type)) exitWith {}; //Bad entry?
_displayName = M_CONFIG(getText,"Licenses",_type,"displayName");
_price = M_CONFIG(getNumber,"Licenses",_type,"price");
_sideFlag = M_CONFIG(getText,"Licenses",_type,"side");
_varName = LICENSE_VARNAME(_type,_sideFlag);
if (CASH < _price) exitWith {hint format [localize "STR_NOTF_NE_1",[_price] call life_fnc_numberText,localize _displayName];};
CASH = CASH - _price;
[0] call SOCK_fnc_updatePartial;
titleText[format [localize "STR_NOTF_B_1", localize _displayName,[_price] call life_fnc_numberText],"PLAIN"];
missionNamespace setVariable [_varName,true];
[2] call SOCK_fnc_updatePartial;

View File

@@ -0,0 +1,96 @@
#include "..\..\script_macros.hpp"
/*
File: fn_captureHideout.sqf
Author: Bryan "Tonic" Boardwine
Description:
Blah blah.
*/
private _altisArray = ["Land_u_Barracks_V2_F","Land_i_Barracks_V2_F"];
private _tanoaArray = ["Land_School_01_F","Land_Warehouse_03_F","Land_House_Small_02_F"];
private _hideoutObjs = [[["Altis", _altisArray], ["Tanoa", _tanoaArray]]] call TON_fnc_terrainSort;
private _hideout = (nearestObjects[getPosATL player,_hideoutObjs,25]) select 0;
private _group = _hideout getVariable ["gangOwner",grpNull];
if (isNil {group player getVariable "gang_name"}) exitWith {titleText[localize "STR_GNOTF_CreateGang","PLAIN"];};
if (_group == group player) exitWith {titleText[localize "STR_GNOTF_Controlled","PLAIN"]};
if ((_hideout getVariable ["inCapture",false])) exitWith {hint localize "STR_GNOTF_onePersonAtATime";};
private "_action";
private "_cpRate";
if (!isNull _group) then {
_gangName = _group getVariable ["gang_name",""];
_action = [
format [localize "STR_GNOTF_AlreadyControlled",_gangName],
localize "STR_GNOTF_CurrentCapture",
localize "STR_Global_Yes",
localize "STR_Global_No"
] call BIS_fnc_guiMessage;
_cpRate = 0.0045;
} else {
_cpRate = 0.0075;
};
if (!isNil "_action" && {!_action}) exitWith {titleText[localize "STR_GNOTF_CaptureCancel","PLAIN"];};
life_action_inUse = true;
//Setup the progress bar
disableSerialization;
private _title = localize "STR_GNOTF_Capturing";
"progressBar" cutRsc ["life_progress","PLAIN"];
private _ui = uiNamespace getVariable "life_progress";
private _progressBar = _ui displayCtrl 38201;
private _titleText = _ui displayCtrl 38202;
_titleText ctrlSetText format ["%2 (1%1)...","%",_title];
_progressBar progressSetPosition 0.01;
private _cP = 0.01;
for "_i" from 0 to 1 step 0 do {
if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
[player,"AinvPknlMstpSnonWnonDnon_medic_1",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
player switchMove "AinvPknlMstpSnonWnonDnon_medic_1";
player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
};
sleep 0.26;
if (isNull _ui) then {
"progressBar" cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progressBar = _ui displayCtrl 38201;
_titleText = _ui displayCtrl 38202;
};
_cP = _cP + _cpRate;
_progressBar progressSetPosition _cP;
_titleText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_title];
_hideout setVariable ["inCapture",true,true];
if (_cP >= 1 || !alive player) exitWith {_hideout setVariable ["inCapture",false,true];};
if (life_istazed) exitWith {_hideout setVariable ["inCapture",false,true];}; //Tazed
if (life_isknocked) exitWith {_hideout setVariable ["inCapture",false,true];}; //Knocked
if (life_interrupted) exitWith {_hideout setVariable ["inCapture",false,true];};
};
//Kill the UI display and check for various states
"progressBar" cutText ["","PLAIN"];
player playActionNow "stop";
if (!alive player || life_istazed || life_isknocked) exitWith {life_action_inUse = false;_hideout setVariable ["inCapture",false,true];};
if (player getVariable ["restrained",false]) exitWith {life_action_inUse = false;_hideout setVariable ["inCapture",false,true];};
if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_GNOTF_CaptureCancel","PLAIN"]; life_action_inUse = false;_hideout setVariable ["inCapture",false,true];};
life_action_inUse = false;
titleText[localize "STR_GNOTF_Captured","PLAIN"];
private _flagTexture = [
"\A3\Data_F\Flags\Flag_red_CO.paa",
"\A3\Data_F\Flags\Flag_green_CO.paa",
"\A3\Data_F\Flags\Flag_blue_CO.paa",
"\A3\Data_F\Flags\Flag_white_CO.paa",
"\A3\Data_F\Flags\flag_fd_red_CO.paa",
"\A3\Data_F\Flags\flag_fd_green_CO.paa",
"\A3\Data_F\Flags\flag_fd_blue_CO.paa",
"\A3\Data_F\Flags\flag_fd_orange_CO.paa"
] call BIS_fnc_selectRandom;
_this select 0 setFlagTexture _flagTexture;
[[0,1],"STR_GNOTF_CaptureSuccess",true,[name player,(group player) getVariable "gang_name"]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
_hideout setVariable ["inCapture",false,true];
_hideout setVariable ["gangOwner",group player,true];

View File

@@ -0,0 +1,30 @@
#include "..\..\script_macros.hpp"
/*
File: fn_catchFish.sqf
Author: Bryan "Tonic" Boardwine
Description:
Catches a fish that is near by.
*/
private ["_fish","_type","_typeName"];
_fish = [_this,0,objNull,[objNull]] call BIS_fnc_param;
if (isNull _fish) exitWith {}; //Object passed is null?
if (player distance _fish > 3.5) exitWith {};
switch (true) do {
case ((typeOf _fish) isEqualTo "Salema_F"): {_typeName = localize "STR_ANIM_Salema"; _type = "salema_raw";};
case ((typeOf _fish) isEqualTo "Ornate_random_F") : {_typeName = localize "STR_ANIM_Ornate"; _type = "ornate_raw";};
case ((typeOf _fish) isEqualTo "Mackerel_F") : {_typeName = localize "STR_ANIM_Mackerel"; _type = "mackerel_raw";};
case ((typeOf _fish) isEqualTo "Tuna_F") : {_typeName = localize "STR_ANIM_Tuna"; _type = "tuna_raw";};
case ((typeOf _fish) isEqualTo "Mullet_F") : {_typeName = localize "STR_ANIM_Mullet"; _type = "mullet_raw";};
case ((typeOf _fish) isEqualTo "CatShark_F") : {_typeName = localize "STR_ANIM_Catshark"; _type = "catshark_raw";};
case ((typeOf _fish) isEqualTo "Turtle_F") : {_typeName = localize "STR_ANIM_Turtle"; _type = "turtle_raw";};
default {_type = ""};
};
if (_type isEqualTo "") exitWith {}; //Couldn't get a type
if ([true,_type,1] call life_fnc_handleInv) then {
deleteVehicle _fish;
titleText[format [(localize "STR_NOTF_Fishing"),_typeName],"PLAIN"];
};

View File

@@ -0,0 +1,21 @@
#include "..\..\script_macros.hpp"
/*
File: fn_dpFinish.sqf
Author: Bryan "Tonic" Boardwine
Description:
Finishes the DP Mission and calculates the money earned based
on distance between A->B
*/
private ["_dp","_dis","_price"];
_dp = [_this,0,objNull,[objNull]] call BIS_fnc_param;
life_delivery_in_progress = false;
life_dp_point = nil;
_dis = round((getPos life_dp_start) distance (getPos _dp));
_price = round(1.7 * _dis);
["DeliverySucceeded",[format [(localize "STR_NOTF_Earned_1"),[_price] call life_fnc_numberText]]] call bis_fnc_showNotification;
life_cur_task setTaskState "Succeeded";
player removeSimpleTask life_cur_task;
CASH = CASH + _price;
[0] call SOCK_fnc_updatePartial;

View File

@@ -0,0 +1,38 @@
/*
File: fn_dropFishingNet.sqf
Author: Bryan "Tonic" Boardwine
Description:
Drops a virtual fishing net from the boat.
*/
private ["_fish","_type","_typeName"];
if (!(vehicle player isKindOf "Ship")) exitWith {};
_fish = (nearestObjects[getPos vehicle player,["Fish_Base_F"],20]);
life_net_dropped = true;
titleText[localize "STR_NOTF_NetDrop","PLAIN"];
sleep 5;
if (_fish isEqualTo []) exitWith {titleText[localize "STR_NOTF_NetDropFail","PLAIN"]; life_net_dropped = false;};
{
if (_x isKindOf "Fish_Base_F") then {
switch (true) do {
case ((typeOf _x) isEqualTo "Salema_F"): {_typeName = localize "STR_ANIM_Salema"; _type = "salema_raw";};
case ((typeOf _x) isEqualTo "Ornate_random_F") : {_typeName = localize "STR_ANIM_Ornate"; _type = "ornate_raw";};
case ((typeOf _x) isEqualTo "Mackerel_F") : {_typeName = localize "STR_ANIM_Mackerel"; _type = "mackerel_raw";};
case ((typeOf _x) isEqualTo "Tuna_F") : {_typeName = localize "STR_ANIM_Tuna"; _type = "tuna_raw";};
case ((typeOf _x) isEqualTo "Mullet_F") : {_typeName = localize "STR_ANIM_Mullet"; _type = "mullet_raw";};
case ((typeOf _x) isEqualTo "CatShark_F") : {_typeName = localize "STR_ANIM_Catshark"; _type = "catshark_raw";};
default {_type = "";};
};
sleep 3;
if ([true,_type,1] call life_fnc_handleInv) then {
deleteVehicle _x;
titleText[format [(localize "STR_NOTF_Fishing"),_typeName],"PLAIN"];
};
};
} forEach (_fish);
sleep 1.5;
titleText[localize "STR_NOTF_NetUp","PLAIN"];
life_net_dropped = false;

View File

@@ -0,0 +1,28 @@
#include "..\..\script_macros.hpp"
/*
File: fn_escortAction.sqf
Author: Bryan "Tonic" Boardwine
Description: Attaches the desired person(_unit) to the player(player) and "escorts them".
*/
private ["_unit"];
_unit = [_this,0,objNull,[objNull]] call BIS_fnc_param;
if (!isNull(player getVariable ["escortingPlayer",objNull])) exitWith {};
if (isNil "_unit" || isNull _unit || !isPlayer _unit) exitWith {};
if (!(side _unit in [civilian,independent])) exitWith {};
if (player distance _unit > 3) exitWith {};
_unit attachTo [player,[0.1,1.1,0]];
player setVariable ["escortingPlayer",_unit];
player setVariable ["isEscorting",true];
_unit setVariable ["transporting",false,true];
_unit setVariable ["Escorting",true,true];
player reveal _unit;
[_unit] spawn {
_unit = _this select 0;
waitUntil {(!(_unit getVariable ["Escorting",false]))};
player setVariable ["escortingPlayer",nil];
player setVariable ["isEscorting",false];
};

View File

@@ -0,0 +1,76 @@
#include "..\..\script_macros.hpp"
/*
File: fn_gather.sqf
Author: Devilfloh
Description:
Main functionality for gathering.
*/
private ["_maxGather","_resource","_amount","_maxGather","_requiredItem"];
if (life_action_inUse) exitWith {};
if !(isNull objectParent player) exitWith {};
if (player getVariable "restrained") exitWith {hint localize "STR_NOTF_isrestrained";};
if (player getVariable "playerSurrender") exitWith {hint localize "STR_NOTF_surrender";};
life_action_inUse = true;
_zone = "";
_requiredItem = "";
_exit = false;
_resourceCfg = missionConfigFile >> "CfgGather" >> "Resources";
for "_i" from 0 to count(_resourceCfg)-1 do {
_curConfig = _resourceCfg select _i;
_resource = configName _curConfig;
_maxGather = getNumber(_curConfig >> "amount");
_zoneSize = getNumber(_curConfig >> "zoneSize");
_resourceZones = getArray(_curConfig >> "zones");
_requiredItem = getText(_curConfig >> "item");
{
if ((player distance (getMarkerPos _x)) < _zoneSize) exitWith {_zone = _x;};
} forEach _resourceZones;
if (_zone != "") exitWith {};
};
if (_zone isEqualTo "") exitWith {life_action_inUse = false;};
if (_requiredItem != "") then {
_valItem = missionNamespace getVariable "life_inv_" + _requiredItem;
if (_valItem < 1) exitWith {
switch (_requiredItem) do {
//Messages here
};
life_action_inUse = false;
_exit = true;
};
};
if (_exit) exitWith {life_action_inUse = false;};
_amount = round(random(_maxGather)) + 1;
_diff = [_resource,_amount,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
if (_diff isEqualTo 0) exitWith {
hint localize "STR_NOTF_InvFull";
life_action_inUse = false;
};
switch (_requiredItem) do {
case "pickaxe": {player say3D "mining";};
default {player say3D "harvest";};
};
for "_i" from 0 to 4 do {
player playMoveNow "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
waitUntil{animationState player != "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";};
sleep 0.5;
};
if ([true,_resource,_diff] call life_fnc_handleInv) then {
_itemName = M_CONFIG(getText,"VirtualItems",_resource,"displayName");
titleText[format [localize "STR_NOTF_Gather_Success",(localize _itemName),_diff],"PLAIN"];
};
sleep 1;
life_action_inUse = false;

View File

@@ -0,0 +1,43 @@
#include "..\..\script_macros.hpp"
/*
File: fn_getDPMission.sqf
Author: Bryan "Tonic" Boardwine
Description:
Selects a random DP point for a delivery mission.
Needs to be revised.
*/
private ["_dp","_target"];
_target = param [0,objNull,[objNull]];
if (str(_target) in LIFE_SETTINGS(getArray,"delivery_points")) then {
private "_point";
_point = LIFE_SETTINGS(getArray,"delivery_points");
_point deleteAt (_point find (str(_target)));
_dp = _point call BIS_fnc_selectRandom;
} else {
_dp = LIFE_SETTINGS(getArray,"delivery_points") call BIS_fnc_selectRandom;
};
life_dp_start = _target;
life_delivery_in_progress = true;
life_dp_point = call compile format ["%1",_dp];
_dp = [_dp,"_"," "] call KRON_Replace;
life_cur_task = player createSimpleTask [format ["Delivery_%1",life_dp_point]];
life_cur_task setSimpleTaskDescription [format [localize "STR_NOTF_DPStart",toUpper _dp],"Delivery Job",""];
life_cur_task setTaskState "Assigned";
player setCurrentTask life_cur_task;
["DeliveryAssigned",[format [localize "STR_NOTF_DPTask",toUpper _dp]]] call bis_fnc_showNotification;
[] spawn {
waitUntil {!life_delivery_in_progress || !alive player};
if (!alive player) then {
life_cur_task setTaskState "Failed";
player removeSimpleTask life_cur_task;
["DeliveryFailed",[localize "STR_NOTF_DPFailed"]] call BIS_fnc_showNotification;
life_delivery_in_progress = false;
life_dp_point = nil;
};
};

View File

@@ -0,0 +1,68 @@
#include "..\..\script_macros.hpp"
/*
File: fn_gutAnimal.sqf
Author: Bryan "Tonic" Boardwine
Description:
Guts the animal?
*/
private ["_animalCorpse","_upp","_ui","_progress","_pgText","_cP","_displayName","_item"];
_animalCorpse = param [0,objNull,[objNull]];
if (isNull _animalCorpse) exitWith {}; //Object passed is null?
life_interrupted = false;
if (player distance _animalCorpse > 3.5) exitWith {}; //WTF need check with nearest objects I love Arma
life_action_inUse = true;
switch (typeOf _animalCorpse) do {
case "Hen_random_F": {_displayName = localize "STR_ANIM_chicken"; _item = "hen_raw";};
case "Cock_random_F": {_displayName = localize "STR_ANIM_Rooster"; _item = "rooster_raw";};
case "Goat_random_F": {_displayName = localize "STR_ANIM_Goat"; _item = "goat_raw";};
case "Sheep_random_F": {_displayName = localize "STR_ANIM_Sheep"; _item = "sheep_raw";};
case "Rabbit_F": {_displayName = localize "STR_ANIM_Rabbit"; _item = "rabbit_raw";};
default {_displayName = ""; _item = "";};
};
if (_displayName isEqualTo "") exitWith {life_action_inUse = false;};
_upp = format [localize "STR_NOTF_Gutting",_displayName];
//Setup our progress bar.
disableSerialization;
"progressBar" cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format ["%2 (1%1)...","%",_upp];
_progress progressSetPosition 0.01;
_cP = 0.01;
for "_i" from 0 to 1 step 0 do {
if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
[player,"AinvPknlMstpSnonWnonDnon_medic_1",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
player switchMove "AinvPknlMstpSnonWnonDnon_medic_1";
player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
};
uiSleep 0.15;
_cP = _cP + 0.01;
_progress progressSetPosition _cP;
_pgText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if (_cP >= 1) exitWith {};
if (!alive player) exitWith {};
if (isNull _animalCorpse) exitWith {};
if !(isNull objectParent player) exitWith {};
if (life_interrupted) exitWith {};
};
life_action_inUse = false;
"progressBar" cutText ["","PLAIN"];
player playActionNow "stop";
if (isNull _animalCorpse) exitWith {life_action_inUse = false;};
if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};
if !(isNull objectParent player) exitWith {titleText[localize "STR_NOTF_ActionInVehicle","PLAIN"];};
if ([true,_item,1] call life_fnc_handleInv) then {
deleteVehicle _animalCorpse;
titleText[format [(localize "STR_NOTF_Guttingfinish"),_displayName],"PLAIN"];
} else {
titleText[(localize "STR_NOTF_InvFull"),"PLAIN"];
};

View File

@@ -0,0 +1,39 @@
#include "..\..\script_macros.hpp"
/*
File: fn_healHospital.sqf
Author: Bryan "Tonic" Boardwine
Reworked: Jesse "TKCJesse" Schultz
Description:
Prompts user with a confirmation dialog to heal themselves.
Used at the hospitals to restore health to full.
Note: Dialog helps stop a few issues regarding money loss.
*/
private ["_healCost","_action"];
if (life_action_inUse) exitWith {};
if ((damage player) < 0.01) exitWith {hint localize "STR_NOTF_HS_FullHealth"};
_healCost = LIFE_SETTINGS(getNumber,"hospital_heal_fee");
if (CASH < _healCost) exitWith {hint format [localize "STR_NOTF_HS_NoCash",[_healCost] call life_fnc_numberText];};
life_action_inUse = true;
_action = [
format [localize "STR_NOTF_HS_PopUp",[_healCost] call life_fnc_numberText],
localize "STR_NOTF_HS_TITLE",
localize "STR_Global_Yes",
localize "STR_Global_No"
] call BIS_fnc_guiMessage;
if (_action) then {
titleText[localize "STR_NOTF_HS_Healing","PLAIN"];
closeDialog 0;
uiSleep 8;
if (player distance (_this select 0) > 5) exitWith {life_action_inUse = false; titleText[localize "STR_NOTF_HS_ToFar","PLAIN"]};
titleText[localize "STR_NOTF_HS_Healed","PLAIN"];
player setDamage 0;
CASH = CASH - _healCost;
life_action_inUse = false;
} else {
hint localize "STR_NOTF_ActionCancel";
closeDialog 0;
life_action_inUse = false;
};

View File

@@ -0,0 +1,80 @@
#include "..\..\script_macros.hpp"
/*
File: fn_impoundAction.sqf
Author: Bryan "Tonic" Boardwine
Description:
Impounds the vehicle
*/
private ["_vehicle","_type","_time","_value","_vehicleData","_upp","_ui","_progress","_pgText","_cP","_filters","_impoundValue","_price","_impoundMultiplier"];
_vehicle = param [0,objNull,[objNull]];
_filters = ["Car","Air","Ship"];
if (!((KINDOF_ARRAY(_vehicle,_filters)))) exitWith {};
if (player distance cursorObject > 10) exitWith {};
if (_vehicle getVariable "NPC") exitWith {hint localize "STR_NPC_Protected"};
_vehicleData = _vehicle getVariable ["vehicle_info_owners",[]];
if (_vehicleData isEqualTo 0) exitWith {deleteVehicle _vehicle}; //Bad vehicle.
_vehicleName = FETCH_CONFIG2(getText,"CfgVehicles",(typeOf _vehicle),"displayName");
_price = M_CONFIG(getNumber,"LifeCfgVehicles",(typeOf _vehicle),"price");
[0,"STR_NOTF_BeingImpounded",true,[((_vehicleData select 0) select 1),_vehicleName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
life_action_inUse = true;
_upp = localize "STR_NOTF_Impounding";
//Setup our progress bar.
disableSerialization;
"progressBar" cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format ["%2 (1%1)...","%",_upp];
_progress progressSetPosition 0.01;
_cP = 0.01;
for "_i" from 0 to 1 step 0 do {
sleep 0.09;
_cP = _cP + 0.01;
_progress progressSetPosition _cP;
_pgText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if (_cP >= 1) exitWith {};
if (player distance _vehicle > 10) exitWith {};
if (!alive player) exitWith {};
};
"progressBar" cutText ["","PLAIN"];
if (player distance _vehicle > 10) exitWith {hint localize "STR_NOTF_ImpoundingCancelled"; life_action_inUse = false;};
if (!alive player) exitWith {life_action_inUse = false;};
if (count crew _vehicle isEqualTo 0) then {
if (!(KINDOF_ARRAY(_vehicle,_filters))) exitWith {life_action_inUse = false;};
_type = FETCH_CONFIG2(getText,"CfgVehicles",(typeOf _vehicle),"displayName");
life_impound_inuse = true;
if (life_HC_isActive) then {
[_vehicle,true,player] remoteExec ["HC_fnc_vehicleStore",HC_Life];
} else {
[_vehicle,true,player] remoteExec ["TON_fnc_vehicleStore",RSERV];
};
waitUntil {!life_impound_inuse};
if (playerSide isEqualTo west) then {
_impoundMultiplier = LIFE_SETTINGS(getNumber,"vehicle_cop_impound_multiplier");
_value = _price * _impoundMultiplier;
[0,"STR_NOTF_HasImpounded",true,[profileName,((_vehicleData select 0) select 1),_vehicleName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
if (_vehicle in life_vehicles) then {
hint format [localize "STR_NOTF_OwnImpounded",[_value] call life_fnc_numberText,_type];
BANK = BANK - _value;
} else {
hint format [localize "STR_NOTF_Impounded",_type,[_value] call life_fnc_numberText];
BANK = BANK + _value;
};
if (BANK < 0) then {BANK = 0;};
[1] call SOCK_fnc_updatePartial;
};
} else {
hint localize "STR_NOTF_ImpoundingCancelled";
};
life_action_inUse = false;

View File

@@ -0,0 +1,106 @@
#include "..\..\script_macros.hpp"
/*
File: fn_mine.sqf
Author: Devilfloh
Editor: Dardo
Description:
Same as fn_gather,but it allows use of probabilities for mining.
*/
private ["_maxGather", "_resource", "_amount", "_requiredItem", "_mined"];
if (life_action_inUse) exitWith {};
if !(isNull objectParent player) exitWith {};
if (player getVariable "restrained") exitWith {
hint localize "STR_NOTF_isrestrained";
};
_exit = false;
if (player getVariable "playerSurrender") exitWith {
hint localize "STR_NOTF_surrender";
};
life_action_inUse = true;
_zone = "";
_requiredItem = "";
_resourceCfg = missionConfigFile >> "CfgGather" >> "Minerals";
_percent = (floor random 100) + 1; //Make sure it's not 0
for "_i" from 0 to count(_resourceCfg)-1 do {
_curConfig = _resourceCfg select _i;
_resources = getArray(_curConfig >> "mined");
_maxGather = getNumber(_curConfig >> "amount");
_zoneSize = getNumber(_curConfig >> "zoneSize");
_resourceZones = getArray(_curConfig >> "zones");
_requiredItem = getText(_curConfig >> "item");
_mined = "";
if (_resources isEqualTo []) exitWith {}; //Smart guy :O
for "_i" from 0 to count (_resources) do {
if (count _resources isEqualTo 1) exitWith {
if (!((_resources select 0) isEqualType [])) then {
_mined = _resources select 0;
} else {
_mined = (_resources select 0) select 0;
};
};
_resource = (_resources select _i) select 0;
_prob = (_resources select _i) select 1;
_probdiff = (_resources select _i) select 2;
if ((_percent >= _prob) && (_percent <= _probdiff)) exitWith {
_mined = _resource;
};
};
{
if ((player distance(getMarkerPos _x)) < _zoneSize) exitWith {
_zone = _x;
};
} forEach _resourceZones;
if (_zone != "") exitWith {};
};
if (_zone isEqualTo "") exitWith {
life_action_inUse = false;
};
if (_requiredItem != "") then {
_valItem = missionNamespace getVariable "life_inv_" + _requiredItem;
if (_valItem < 1) exitWith {
switch (_requiredItem) do {
case "pickaxe": {
titleText[(localize "STR_NOTF_Pickaxe"), "PLAIN"];
};
};
life_action_inUse = false;
_exit = true;
};
};
if (_exit) exitWith {
life_action_inUse = false;
};
_amount = round(random(_maxGather)) + 1;
_diff = [_mined, _amount, life_carryWeight, life_maxWeight] call life_fnc_calWeightDiff;
if (_diff isEqualTo 0) exitWith {
hint localize "STR_NOTF_InvFull";
life_action_inUse = false;
};
player say3D "mining";
for "_i" from 0 to 4 do {
player playMoveNow "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
waitUntil {
animationState player != "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
};
sleep 0.5;
};
if (([true, _mined, _diff] call life_fnc_handleInv)) then {
_itemName = M_CONFIG(getText, "VirtualItems", _mined, "displayName");
titleText[format [localize "STR_NOTF_Mine_Success", (localize _itemName), _diff], "PLAIN"];
};
sleep 2.5;
life_action_inUse = false;

View File

@@ -0,0 +1,39 @@
#include "..\..\script_macros.hpp"
/*
File: fn_newsBroadcast.sqf
Author: Jesse "tkcjesse" Schultz
Description:
Creates the dialog and handles the data in the Channel 7 News Dialog.
*/
#define Confirm 100104
private ["_msgCost","_display","_confirmBtn","_msgCooldown","_broadcastDelay"];
if (!dialog) then {
createDialog "life_news_broadcast";
};
disableSerialization;
_display = findDisplay 100100;
_confirmBtn = _display displayCtrl Confirm;
_confirmBtn ctrlEnable false;
_msgCooldown = (60 * LIFE_SETTINGS(getNumber,"news_broadcast_cooldown"));
_msgCost = LIFE_SETTINGS(getNumber,"news_broadcast_cost");
if (CASH < _msgCost) then {
hint format [localize "STR_News_NotEnough",[_msgCost] call life_fnc_numberText];
} else {
_confirmBtn ctrlEnable true;
_confirmBtn buttonSetAction "[ctrlText 100101,ctrlText 100102,profilename] call life_fnc_postNewsBroadcast; closeDialog 0;";
};
if (isNil "life_broadcastTimer" || {(time - life_broadcastTimer) > _msgCooldown}) then {
_broadcastDelay = localize "STR_News_Now";
} else {
_broadcastDelay = [(_msgCooldown - (time - life_broadcastTimer))] call BIS_fnc_secondsToString;
_confirmBtn ctrlEnable false;
};
CONTROL(100100,100103) ctrlSetStructuredText parseText format [ localize "STR_News_StructuredText",[_msgCost] call life_fnc_numberText,_broadcastDelay];

View File

@@ -0,0 +1,17 @@
/*
File: fn_packupSpikes.sqf
Author: Bryan "Tonic" Boardwine
Description:
Packs up a deployed spike strip.
*/
private ["_spikes"];
_spikes = nearestObjects[getPos player,["Land_Razorwire_F"],8] select 0;
if (isNil "_spikes") exitWith {};
if ([true,"spikeStrip",1] call life_fnc_handleInv) then {
titleText[localize "STR_NOTF_SpikeStrip","PLAIN"];
player removeAction life_action_spikeStripPickup;
life_action_spikeStripPickup = nil;
deleteVehicle _spikes;
};

View File

@@ -0,0 +1,62 @@
#include "..\..\script_macros.hpp"
#define INUSE(ENTITY) ENTITY setVariable ["inUse",false,true]
/*
File: fn_pickupItem.sqf
Author: Bryan "Tonic" Boardwine
Description:
Master handling for picking up an item.
*/
private ["_itemInfo","_itemName","_illegal","_diff"];
if ((time - life_action_delay) < 2) exitWith {hint localize "STR_NOTF_ActionDelay"; INUSE(_this);};
if (isNull _this || {player distance _this > 3}) exitWith {INUSE(_this);};
_itemInfo = _this getVariable ["item",[]]; if (count _itemInfo isEqualTo 0) exitWith {deleteVehicle _this;};
_illegal = ITEM_ILLEGAL(_itemInfo select 0);
_itemName = ITEM_NAME(_itemInfo select 0);
if (isLocalized _itemName) then {
_itemName = (localize _itemName);
};
if (playerSide isEqualTo west && _illegal isEqualTo 1) exitWith {
titleText[format [localize "STR_NOTF_PickedEvidence",_itemName,[round(ITEM_SELLPRICE(_itemInfo select 0) / 2)] call life_fnc_numberText],"PLAIN"];
BANK = BANK + round(ITEM_SELLPRICE(_itemInfo select 0) / 2);
deleteVehicle _this;
[1] call SOCK_fnc_updatePartial;
life_action_delay = time;
};
life_action_delay = time;
_diff = [(_itemInfo select 0),(_itemInfo select 1),life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
if (_diff <= 0) exitWith {hint localize "STR_NOTF_InvFull"; INUSE(_this);};
if (!(_diff isEqualTo (_itemInfo select 1))) then {
if ([true,(_itemInfo select 0),_diff] call life_fnc_handleInv) then {
player playMove "AinvPknlMstpSlayWrflDnon";
_this setVariable ["item",[(_itemInfo select 0),(_itemInfo select 1) - _diff],true];
titleText[format [localize "STR_NOTF_Picked",_diff,_itemName],"PLAIN"];
INUSE(_this);
} else {
INUSE(_this);
};
} else {
if ([true,(_itemInfo select 0),(_itemInfo select 1)] call life_fnc_handleInv) then {
deleteVehicle _this;
//waitUntil{isNull _this};
player playMove "AinvPknlMstpSlayWrflDnon";
titleText[format [localize "STR_NOTF_Picked",_diff,_itemName],"PLAIN"];
} else {
INUSE(_this);
};
};
if (LIFE_SETTINGS(getNumber,"player_advancedLog") isEqualTo 1) then {
if (LIFE_SETTINGS(getNumber,"battlEye_friendlyLogging") isEqualTo 1) then {
advanced_log = format [localize "STR_DL_AL_pickedUp_BEF",_diff,_itemName];
} else {
advanced_log = format [localize "STR_DL_AL_pickedUp",profileName,(getPlayerUID player),_diff,_itemName];
};
publicVariableServer "advanced_log";
};

View File

@@ -0,0 +1,37 @@
#include "..\..\script_macros.hpp"
/*
File: fn_pickupMoney.sqf
Author: Bryan "Tonic" Boardwine
Description:
Picks up money
*/
private "_value";
if ((time - life_action_delay) < 1.5) exitWith {hint localize "STR_NOTF_ActionDelay"; _this setVariable ["inUse",false,true];};
if (isNull _this || {player distance _this > 3}) exitWith {_this setVariable ["inUse",false,true];};
_value = ((_this getVariable "item") select 1);
if (!isNil "_value") exitWith {
deleteVehicle _this;
switch (true) do {
case (_value > 20000000) : {_value = 100000;}; //VAL>20mil->100k
case (_value > 5000000) : {_value = 250000;}; //VAL>5mil->250k
default {};
};
player playMove "AinvPknlMstpSlayWrflDnon";
titleText[format [localize "STR_NOTF_PickedMoney",[_value] call life_fnc_numberText],"PLAIN"];
CASH = CASH + _value;
[0] call SOCK_fnc_updatePartial;
life_action_delay = time;
if (LIFE_SETTINGS(getNumber,"player_moneyLog") isEqualTo 1) then {
if (LIFE_SETTINGS(getNumber,"battlEye_friendlyLogging") isEqualTo 1) then {
money_log = format [localize "STR_DL_ML_pickedUpMoney_BEF",[_value] call life_fnc_numberText,[BANK] call life_fnc_numberText,[CASH] call life_fnc_numberText];
} else {
money_log = format [localize "STR_DL_ML_pickedUpMoney",profileName,(getPlayerUID player),[_value] call life_fnc_numberText,[BANK] call life_fnc_numberText,[CASH] call life_fnc_numberText];
};
publicVariableServer "money_log";
};
};

View File

@@ -0,0 +1,20 @@
#include "..\..\script_macros.hpp"
/*
File: fn_postBail.sqf
Author: Bryan "Tonic" Boardwine
Description:
Called when the player attempts to post bail.
Needs to be revised.
*/
private ["_unit"];
_unit = param [1,objNull,[objNull]];
if (life_bail_paid) exitWith {};
if (isNil "life_bail_amount") then {life_bail_amount = 3500;};
if (!life_canpay_bail) exitWith {hint localize "STR_NOTF_Bail_Post"};
if (BANK < life_bail_amount) exitWith {hint format [localize "STR_NOTF_Bail_NotEnough",life_bail_amount];};
BANK = BANK - life_bail_amount;
life_bail_paid = true;
[1] call SOCK_fnc_updatePartial;
[0,"STR_NOTF_Bail_Bailed",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];

View File

@@ -0,0 +1,147 @@
#include "..\..\script_macros.hpp"
/*
File: fn_processAction.sqf
Author: Bryan "Tonic" Boardwine
Modified : NiiRoZz
Description:
Master handling for processing an item.
NiiRoZz : Added multiprocess
*/
private ["_vendor","_type","_itemInfo","_oldItem","_newItemWeight","_newItem","_oldItemWeight","_cost","_upp","_hasLicense","_itemName","_oldVal","_ui","_progress","_pgText","_cP","_materialsRequired","_materialsGiven","_noLicenseCost","_text","_filter","_totalConversions","_minimumConversions"];
_vendor = [_this,0,objNull,[objNull]] call BIS_fnc_param;
_type = [_this,3,"",[""]] call BIS_fnc_param;
//Error check
if (isNull _vendor || _type isEqualTo "" || (player distance _vendor > 10)) exitWith {};
life_action_inUse = true;//Lock out other actions during processing.
if (isClass (missionConfigFile >> "ProcessAction" >> _type)) then {
_filter = false;
_materialsRequired = M_CONFIG(getArray,"ProcessAction",_type,"MaterialsReq");
_materialsGiven = M_CONFIG(getArray,"ProcessAction",_type,"MaterialsGive");
_noLicenseCost = M_CONFIG(getNumber,"ProcessAction",_type,"NoLicenseCost");
_text = M_CONFIG(getText,"ProcessAction",_type,"Text");
} else {_filter = true;};
if (_filter) exitWith {life_action_inUse = false;};
_itemInfo = [_materialsRequired,_materialsGiven,_noLicenseCost,(localize format ["%1",_text])];
if (count _itemInfo isEqualTo 0) exitWith {life_action_inUse = false;};
//Setup vars.
_oldItem = _itemInfo select 0;
_newItem = _itemInfo select 1;
_cost = _itemInfo select 2;
_upp = _itemInfo select 3;
_exit = false;
if (count _oldItem isEqualTo 0) exitWith {life_action_inUse = false;};
_totalConversions = [];
{
_var = ITEM_VALUE(_x select 0);
if (_var isEqualTo 0) exitWith {_exit = true;};
if (_var < (_x select 1)) exitWith {_exit = true;};
_totalConversions pushBack (floor (_var/(_x select 1)));
} forEach _oldItem;
if (_exit) exitWith {life_is_processing = false; hint localize "STR_NOTF_NotEnoughItemProcess"; life_action_inUse = false;};
if (_vendor in [mari_processor,coke_processor,heroin_processor]) then {
_hasLicense = true;
} else {
_hasLicense = LICENSE_VALUE(_type,"civ");
};
_cost = _cost * (count _oldItem);
_minimumConversions = _totalConversions call BIS_fnc_lowestNum;
_oldItemWeight = 0;
{
_weight = ([_x select 0] call life_fnc_itemWeight) * (_x select 1);
_oldItemWeight = _oldItemWeight + _weight;
} count _oldItem;
_newItemWeight = 0;
{
_weight = ([_x select 0] call life_fnc_itemWeight) * (_x select 1);
_newItemWeight = _newItemWeight + _weight;
} count _newItem;
_exit = false;
if (_newItemWeight > _oldItemWeight) then {
_netChange = _newItemWeight - _oldItemWeight;
_freeSpace = life_maxWeight - life_carryWeight;
if (_freeSpace < _netChange) exitWith {_exit = true;};
private _estConversions = floor(_freeSpace / _netChange);
if (_estConversions < _minimumConversions) then {
_minimumConversions = _estConversions;
};
};
if (_exit) exitWith {hint localize "STR_Process_Weight"; life_is_processing = false; life_action_inUse = false;};
//Setup our progress bar.
disableSerialization;
"progressBar" cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format ["%2 (1%1)...","%",_upp];
_progress progressSetPosition 0.01;
_cP = 0.01;
life_is_processing = true;
if (_hasLicense) then {
for "_i" from 0 to 1 step 0 do {
sleep 0.28;
_cP = _cP + 0.01;
_progress progressSetPosition _cP;
_pgText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if (_cP >= 1) exitWith {};
if (player distance _vendor > 10) exitWith {};
};
if (player distance _vendor > 10) exitWith {hint localize "STR_Process_Stay"; "progressBar" cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
{
[false,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _oldItem;
{
[true,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _newItem;
"progressBar" cutText ["","PLAIN"];
if (_minimumConversions isEqualTo (_totalConversions call BIS_fnc_lowestNum)) then {hint localize "STR_NOTF_ItemProcess";} else {hint localize "STR_Process_Partial";};
life_is_processing = false; life_action_inUse = false;
} else {
if (CASH < _cost) exitWith {hint format [localize "STR_Process_License",[_cost] call life_fnc_numberText]; "progressBar" cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
for "_i" from 0 to 1 step 0 do {
sleep 0.9;
_cP = _cP + 0.01;
_progress progressSetPosition _cP;
_pgText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if (_cP >= 1) exitWith {};
if (player distance _vendor > 10) exitWith {};
};
if (player distance _vendor > 10) exitWith {hint localize "STR_Process_Stay"; "progressBar" cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
if (CASH < _cost) exitWith {hint format [localize "STR_Process_License",[_cost] call life_fnc_numberText]; "progressBar" cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
{
[false,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _oldItem;
{
[true,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _newItem;
"progressBar" cutText ["","PLAIN"];
if (_minimumConversions isEqualTo (_totalConversions call BIS_fnc_lowestNum)) then {hint localize "STR_NOTF_ItemProcess";} else {hint localize "STR_Process_Partial";};
CASH = CASH - _cost;
[0] call SOCK_fnc_updatePartial;
life_is_processing = false;
life_action_inUse = false;
};

View File

@@ -0,0 +1,17 @@
#include "..\..\script_macros.hpp"
/*
File: fn_pulloutAction.sqf
Author: Bryan "Tonic" Boardwine
Description:
Pulls civilians out of a car if it's stopped.
*/
private ["_crew"];
_crew = crew cursorObject;
{
if !(side _x isEqualTo west) then {
_x setVariable ["transporting",false,true]; _x setVariable ["Escorting",false,true];
[_x] remoteExecCall ["life_fnc_pulloutVeh",_x];
};
} forEach _crew;

View File

@@ -0,0 +1,19 @@
#include "..\..\script_macros.hpp"
/*
File: fn_putInCar.sqf
Author: Bryan "Tonic" Boardwine
Description:
Finds the nearest vehicle and loads the target into the vehicle.
*/
private ["_unit"];
_unit = param [0,objNull,[objNull]];
if (isNull _unit || !isPlayer _unit) exitWith {};
_nearestVehicle = nearestObjects[getPosATL player,["Car","Ship","Submarine","Air"],10] select 0;
if (isNil "_nearestVehicle") exitWith {hint localize "STR_NOTF_VehicleNear"};
detach _unit;
[_nearestVehicle] remoteExecCall ["life_fnc_moveIn",_unit];
_unit setVariable ["Escorting",false,true];
_unit setVariable ["transporting",true,true];

View File

@@ -0,0 +1,48 @@
#include "..\..\script_macros.hpp"
/*
File : removeContainer.sqf
Author: NiiRoZz
Description:
Delete Container from house storage
*/
private ["_house","_action","_container","_containerType","_containers"];
_container = param [0,objNull,[objNull]];
_containerType = typeOf _container;
_house = nearestObject [player, "House"];
if (!(_house in life_vehicles)) exitWith {hint localize "STR_ISTR_Box_NotinHouse"};
if (isNull _container) exitWith {};
_containers = _house getVariable ["containers",[]];
closeDialog 0;
_action = [
format [localize "STR_House_DeleteContainerMSG"],localize "STR_pInAct_RemoveContainer",localize "STR_Global_Remove",localize "STR_Global_Cancel"
] call BIS_fnc_guiMessage;
if (_action) then {
private ["_box","_diff"];
_box = switch (_containerType) do {
case ("B_supplyCrate_F"): {"storagebig"};
case ("Box_IND_Grenades_F"): {"storagesmall"};
default {"None"};
};
if (_box == "None") exitWith {};
_diff = [_box,1,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
if (_diff isEqualTo 0) exitWith {hint localize "STR_NOTF_InvFull"};
if (life_HC_isActive) then {
[_container] remoteExecCall ["HC_fnc_deleteDBContainer",HC_Life];
} else {
[_container] remoteExecCall ["TON_fnc_deleteDBContainer",RSERV];
};
{
if (_x == _container) then {
_containers deleteAt _forEachIndex;
};
} forEach _containers;
_house setVariable ["containers",_containers,true];
[true,_box,1] call life_fnc_handleInv;
};

View File

@@ -0,0 +1,71 @@
#include "..\..\script_macros.hpp"
/*
File: fn_repairTruck.sqf
Author: Bryan "Tonic" Boardwine
Description:
Main functionality for toolkits, to be revised in later version.
*/
private ["_veh","_upp","_ui","_progress","_pgText","_cP","_displayName","_test","_sideRepairArray"];
_veh = cursorObject;
life_interrupted = false;
if (isNull _veh) exitWith {};
if ((_veh isKindOf "Car") || (_veh isKindOf "Ship") || (_veh isKindOf "Air")) then {
if (life_inv_toolkit > 0) then {
life_action_inUse = true;
_displayName = FETCH_CONFIG2(getText,"CfgVehicles",(typeOf _veh),"displayName");
_upp = format [localize "STR_NOTF_Repairing",_displayName];
//Setup our progress bar.
disableSerialization;
"progressBar" cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format ["%2 (1%1)...","%",_upp];
_progress progressSetPosition 0.01;
_cP = 0.01;
for "_i" from 0 to 1 step 0 do {
if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
[player,"AinvPknlMstpSnonWnonDnon_medic_1",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
player switchMove "AinvPknlMstpSnonWnonDnon_medic_1";
player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
};
sleep 0.27;
_cP = _cP + 0.01;
_progress progressSetPosition _cP;
_pgText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if (_cP >= 1) exitWith {};
if (!alive player) exitWith {};
if !(isNull objectParent player) exitWith {};
if (life_interrupted) exitWith {};
};
life_action_inUse = false;
"progressBar" cutText ["","PLAIN"];
player playActionNow "stop";
if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};
if !(isNull objectParent player) exitWith {titleText[localize "STR_NOTF_ActionInVehicle","PLAIN"];};
_sideRepairArray = LIFE_SETTINGS(getArray,"vehicle_infiniteRepair");
//Check if playerSide has infinite repair enabled
if (playerSide isEqualTo civilian && (_sideRepairArray select 0) isEqualTo 0) then {
[false,"toolkit",1] call life_fnc_handleInv;
};
if (playerSide isEqualTo west && (_sideRepairArray select 1) isEqualTo 0) then {
[false,"toolkit",1] call life_fnc_handleInv;
};
if (playerSide isEqualTo independent && (_sideRepairArray select 2) isEqualTo 0) then {
[false,"toolkit",1] call life_fnc_handleInv;
};
if (playerSide isEqualTo east && (_sideRepairArray select 3) isEqualTo 0) then {
[false,"toolkit",1] call life_fnc_handleInv;
};
_veh setDamage 0;
titleText[localize "STR_NOTF_RepairedVehicle","PLAIN"];
};
};

View File

@@ -0,0 +1,21 @@
#include "..\..\script_macros.hpp"
/*
File: fn_restrainAction.sqf
Author: Bryan "Tonic" Boardwine
Description:
Restrains the target.
*/
private ["_unit"];
_unit = cursorObject;
if (isNull _unit) exitWith {}; //Not valid
if (player distance _unit > 3) exitWith {};
if (_unit getVariable "restrained") exitWith {};
if (side _unit isEqualTo west) exitWith {};
if (player isEqualTo _unit) exitWith {};
if (!isPlayer _unit) exitWith {};
//Broadcast!
_unit setVariable ["restrained",true,true];
[player] remoteExec ["life_fnc_restrain",_unit];
[0,"STR_NOTF_Restrained",true,[_unit getVariable ["realname", name _unit], profileName]] remoteExecCall ["life_fnc_broadcast",west];

View File

@@ -0,0 +1,18 @@
#include "..\..\script_macros.hpp"
/*
File: fn_robAction.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the robbing process?
*/
private ["_target"];
_target = cursorObject;
//Error checks
if (isNull _target) exitWith {};
if (!isPlayer _target) exitWith {};
if (_target getVariable ["robbed",false]) exitWith {};
[player] remoteExecCall ["life_fnc_robPerson",_target];
_target setVariable ["robbed",true,true];

View File

@@ -0,0 +1,16 @@
/*
File: fn_searchAction.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the searching process.
*/
params [
["_unit",objNull,[objNull]]
];
if (isNull _unit) exitWith {};
hint localize "STR_NOTF_Searching";
sleep 2;
if (player distance _unit > 5 || !alive player || !alive _unit) exitWith {hint localize "STR_NOTF_CannotSearchPerson"};
[player] remoteExec ["life_fnc_searchClient",_unit];
life_action_inUse = true;

View File

@@ -0,0 +1,30 @@
#include "..\..\script_macros.hpp"
/*
File: fn_searchVehAction.sqf
Author:
Description:
*/
private ["_vehicle","_data"];
_vehicle = cursorObject;
if ((_vehicle isKindOf "Car") || !(_vehicle isKindOf "Air") || !(_vehicle isKindOf "Ship")) then {
_owners = _vehicle getVariable "vehicle_info_owners";
if (isNil "_owners") exitWith {hint localize "STR_NOTF_VehCheat"; deleteVehicle _vehicle;};
life_action_inUse = true;
hint localize "STR_NOTF_Searching";
sleep 3;
life_action_inUse = false;
if (player distance _vehicle > 10 || !alive player || !alive _vehicle) exitWith {hint localize "STR_NOTF_SearchVehFail";};
//_inventory = [(_vehicle getVariable "vehicle_info_inv")] call fnc_veh_inv;
//if (isNil {_inventory}) then {_inventory = "Nothing in storage."};
_owners = [_owners] call life_fnc_vehicleOwners;
if (_owners == "any<br/>") then {
_owners = "No owners, impound it<br/>";
};
hint parseText format [localize "STR_NOTF_SearchVeh",_owners];
};

View File

@@ -0,0 +1,17 @@
#include "..\..\script_macros.hpp"
/*
File: fn_seizePlayerAction.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the seize process..
Based off Tonic's fn_searchAction.sqf
*/
params [
["_unit",objNull,[objNull]]
];
if (isNull _unit) exitWith {};
sleep 2;
if (player distance _unit > 5 || !alive player || !alive _unit) exitWith {hint localize "STR_NOTF_CannotSeizePerson"};
[player] remoteExec ["life_fnc_seizeClient",_unit];
life_action_inUse = false;

View File

@@ -0,0 +1,50 @@
#include "..\..\script_macros.hpp"
/*
File: fn_serviceChopper.sqf
Author: Bryan "Tonic" Boardwine
Description:
Main functionality for the chopper service paid, to be replaced in later version.
*/
private ["_serviceCost"];
disableSerialization;
private ["_search","_ui","_progress","_cP","_pgText"];
if (life_action_inUse) exitWith {hint localize "STR_NOTF_Action"};
_serviceCost = LIFE_SETTINGS(getNumber,"service_chopper");
_search = nearestObjects[getPos air_sp, ["Air"],10];
if (count _search isEqualTo 0) exitWith {hint localize "STR_Service_Chopper_NoAir"};
if (CASH < _serviceCost) exitWith {hint localize "STR_Serive_Chopper_NotEnough"};
life_action_inUse = true;
"progressBar" cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format [localize "STR_Service_Chopper_Servicing","waiting..."];
_progress progressSetPosition 0.01;
_cP = 0.01;
for "_i" from 0 to 1 step 0 do {
sleep 0.2;
_cP = _cP + 0.01;
_progress progressSetPosition _cP;
_pgText ctrlSetText format [localize "STR_Service_Chopper_Servicing",round(_cP * 100)];
if (_cP >= 1) exitWith {};
};
if (!alive (_search select 0) || (_search select 0) distance air_sp > 15) exitWith {life_action_inUse = false; hint localize "STR_Service_Chopper_Missing"};
CASH = CASH - _serviceCost;
if (!local (_search select 0)) then {
[(_search select 0),1] remoteExecCall ["life_fnc_setFuel",(_search select 0)];
} else {
(_search select 0) setFuel 1;
};
(_search select 0) setDamage 0;
"progressBar" cutText ["","PLAIN"];
titleText [localize "STR_Service_Chopper_Done","PLAIN"];
life_action_inUse = false;

View File

@@ -0,0 +1,18 @@
#include "..\..\script_macros.hpp"
/*
File: fn_stopEscorting.sqf
Author: Bryan "Tonic" Boardwine
Description:
Detaches player(_unit) from the Escorter(player) and sets them back down.
*/
private ["_unit"];
_unit = player getVariable ["escortingPlayer",objNull];
if (isNull _unit) then {_unit = cursorTarget;}; //Emergency fallback.
if (isNull _unit) exitWith {}; //Target not found even after using cursorTarget.
if (!(_unit getVariable ["Escorting",false])) exitWith {}; //He's not being Escorted.
if !(side _unit isEqualTo civilian) exitWith {}; //Not a civ
detach _unit;
_unit setVariable ["Escorting",false,true];
player setVariable ["currentlyEscorting",nil];
player setVariable ["isEscorting",false];

View File

@@ -0,0 +1,41 @@
#include "..\..\script_macros.hpp"
/*
File: fn_storeVehicle.sqf
Author: Bryan "Tonic" Boardwine
Description:
Stores the vehicle in the garage.
*/
private ["_nearVehicles","_vehicle"];
if !(isNull objectParent player) then {
_vehicle = vehicle player;
} else {
_nearVehicles = nearestObjects[getPos (_this select 0),["Car","Air","Ship"],30]; //Fetch vehicles within 30m.
if (count _nearVehicles > 0) then {
{
if (!isNil "_vehicle") exitWith {}; //Kill the loop.
_vehData = _x getVariable ["vehicle_info_owners",[]];
if (count _vehData > 0) then {
_vehOwner = ((_vehData select 0) select 0);
if ((getPlayerUID player) == _vehOwner) exitWith {
_vehicle = _x;
};
};
} forEach _nearVehicles;
};
};
if (isNil "_vehicle") exitWith {hint localize "STR_Garage_NoNPC"};
if (isNull _vehicle) exitWith {};
if (!alive _vehicle) exitWith {hint localize "STR_Garage_SQLError_Destroyed"};
_storetext = localize "STR_Garage_Store_Success";
if (life_HC_isActive) then {
[_vehicle,false,(_this select 1),_storetext] remoteExec ["HC_fnc_vehicleStore",HC_Life];
} else {
[_vehicle,false,(_this select 1),_storetext] remoteExec ["TON_fnc_vehicleStore",RSERV];
};
hint localize "STR_Garage_Store_Server";
life_garage_store = true;

View File

@@ -0,0 +1,24 @@
#include "..\..\script_macros.hpp"
/*
File: fn_surrender.sqf
Author:
Description: Causes player to put their hands on their head.
*/
if ( player getVariable ["restrained",false] ) exitWith {};
if ( player getVariable ["Escorting",false] ) exitWith {};
if ( vehicle player != player ) exitWith {};
if ( speed player > 1 ) exitWith {};
if (player getVariable ["playerSurrender",false]) then {
player setVariable ["playerSurrender",false,true];
} else {
player setVariable ["playerSurrender",true,true];
};
while {player getVariable ["playerSurrender",false]} do {
player playMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
if (!alive player || !(isNull objectParent player)) then { player setVariable ["playerSurrender",false,true]; };
};
player playMoveNow "AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon";

View File

@@ -0,0 +1,15 @@
/*
File: fn_ticketAction.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the ticketing process.
*/
params [
["_unit",objNull,[objNull]]
];
disableSerialization;
if (!(createDialog "life_ticket_give")) exitWith {hint localize "STR_Cop_TicketFail"};
if (isNull _unit || !isPlayer _unit) exitWith {};
ctrlSetText[2651,format [localize "STR_Cop_Ticket",_unit getVariable ["realname",name _unit]]];
life_ticket_unit = _unit;

View File

@@ -0,0 +1,18 @@
#include "..\..\script_macros.hpp"
/*
File: fn_unrestrain.sqf
Author:
Description:
*/
private ["_unit"];
_unit = param [0,objNull,[objNull]];
if (isNull _unit || !(_unit getVariable ["restrained",false])) exitWith {}; //Error check?
_unit setVariable ["restrained",false,true];
_unit setVariable ["Escorting",false,true];
_unit setVariable ["transporting",false,true];
detach _unit;
[0,"STR_NOTF_Unrestrain",true,[_unit getVariable ["realname",name _unit], profileName]] remoteExecCall ["life_fnc_broadcast",west];

View File

@@ -0,0 +1,29 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminCompensate.sqf
Author: ColinM9991
Description:
Figure it out.
*/
private ["_value","_action"];
if (FETCH_CONST(life_adminlevel) < 2) exitWith {closeDialog 0; hint localize "STR_ANOTF_ErrorLevel";};
_value = parseNumber(ctrlText 9922);
if (_value < 0) exitWith {};
if (_value > 999999) exitWith {hint localize "STR_ANOTF_Fail"};
_action = [
format [localize "STR_ANOTF_CompWarn",[_value] call life_fnc_numberText],
localize "STR_Admin_Compensate",
localize "STR_Global_Yes",
localize "STR_Global_No"
] call BIS_fnc_guiMessage;
if (_action) then {
CASH = CASH + _value;
hint format [localize "STR_ANOTF_Success",[_value] call life_fnc_numberText];
closeDialog 0;
} else {
hint localize "STR_NOTF_ActionCancel";
closeDialog 0;
};

View File

@@ -0,0 +1,13 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminDebugCon.sqf
Author: ColinM9991
Description:
Opens the Debug Console.
*/
if (FETCH_CONST(life_adminlevel) < 5) exitWith {closeDialog 0; hint localize "STR_NOTF_adminDebugCon";};
life_admin_debug = true;
createDialog "RscDisplayDebugPublic";
[0,format [localize "STR_NOTF_adminHasOpenedDebug",profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];

View File

@@ -0,0 +1,16 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminFreeze.sqf
Author: ColinM9991
Description: Freezes selected player
*/
if (FETCH_CONST(life_adminlevel) < 4) exitWith {closeDialog 0; hint localize "STR_ANOTF_ErrorLevel";};
private _unit = lbData[2902,lbCurSel (2902)];
_unit = call compile format ["%1", _unit];
if (isNil "_unit") exitWith {};
if (isNull _unit) exitWith {};
if (_unit == player) exitWith {hint localize "STR_ANOTF_Error";};
[player] remoteExec ["life_fnc_freezePlayer",_unit];

View File

@@ -0,0 +1,15 @@
/*
File: fn_adminGetID.sqf
Author: Bryan "Tonic" Boardwine
Description:
Fetches the selected ID of the player.
Used by in-game admins to issue bans/kicks.
https://community.bistudio.com/wiki/Multiplayer_Server_Commands
*/
private _unit = lbData[2902,lbCurSel (2902)];
_unit = call compile format ["%1", _unit];
if (isNil "_unit") exitWith {};
if (isNull _unit) exitWith {};
[_unit,player] remoteExecCall ["TON_fnc_getID",2];

View File

@@ -0,0 +1,21 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminGodMode.sqf
Author: Tobias 'Xetoxyc' Sittenauer
Description: Enables God mode for Admin
*/
if (FETCH_CONST(life_adminlevel) < 4) exitWith {closeDialog 0; hint localize "STR_ANOTF_ErrorLevel";};
closeDialog 0;
if (life_god) then {
life_god = false;
titleText [localize "STR_ANOTF_godModeOff","PLAIN"]; titleFadeOut 2;
player allowDamage true;
} else {
life_god = true;
titleText [localize "STR_ANOTF_godModeOn","PLAIN"]; titleFadeOut 2;
player allowDamage false;
};

View File

@@ -0,0 +1,14 @@
/*
File: fn_adminID.sqf
Author: Bryan "Tonic" Boardwine
Description:
Output information received to admin menu.
*/
private ["_display","_ret","_text"];
disableSerialization;
_ret = _this select 0;
_display = findDisplay 2900;
_text = _display displayCtrl 2903;
_text ctrlSetStructuredText parseText format ["ID: %1",_ret];

View File

@@ -0,0 +1,46 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminInfo.sqf
Author: Bryan "Tonic" Boardwine
Description:
Output information received to admin menu.
*/
private ["_ret","_unit","_prim","_sec","_vest","_uni","_bp","_attach","_steamName","_secondary"];
_ret = _this;
disableSerialization;
_unit = _ret select 3;
_prim = if (!(primaryWeapon _unit isEqualTo "")) then { FETCH_CONFIG2(getText,"CfgWeapons",primaryWeapon _unit,"displayName")} else {"None"};
_sec = if (!(handgunWeapon _unit isEqualTo "")) then { FETCH_CONFIG2(getText,"CfgWeapons",handgunWeapon _unit,"displayName")} else {"None"};
_vest = if (!(vest _unit isEqualTo "")) then { FETCH_CONFIG2(getText,"CfgWeapons",vest _unit,"displayName")} else {"None"};
_uni = if (!(uniform _unit isEqualTo "")) then { FETCH_CONFIG2(getText,"CfgWeapons",uniform _unit,"displayName")} else {"None"};
_bp = if (!(backpack _unit isEqualTo "")) then {FETCH_CONFIG2(getText,"CfgVehicles",backpack _unit,"displayName")} else {"None"};
_attach = [];
_secondary = [];
if (!(primaryWeapon _unit isEqualTo "")) then {
{
if (!(_x isEqualTo "")) then {
_attach pushBack (FETCH_CONFIG2(getText,"CfgWeapons",_x,"displayName"));
};
} forEach (primaryWeaponItems _unit);
};
if (!(handgunItems _unit isEqualTo "")) then {
{
if (!(_x isEqualTo "")) then {
_secondary pushBack (FETCH_CONFIG2(getText,"CfgWeapons",_x,"displayName"));
};
} forEach (handgunItems _unit);
};
_steamName = _ret select 4;
if (!((_ret select 4) isEqualType "")) then {
_steamName = "Not a Steam User!";
};
if (count _attach isEqualTo 0) then {_attach = "None"};
if (count _secondary isEqualTo 0) then {_secondary = "None"};
CONTROL(2900,2903) ctrlSetStructuredText parseText format ["<t size='.7'>Name: %1<br/>Steam Name: %10<br/>Player UID: %11<br/>Player Side: %12<br/>Bank: %2<br/>Money: %3<br/>Uniform: %4<br/>Vest: %5<br/>Backpack: %6<br/>Primary: %7<br/>Handgun: %8<br/><t align='center'>Primary Attachments</t><br/>%9<br/><t align='center'>Secondary Attachments</t><br/>%13<br/></t>",
_unit getVariable ["realname",name _unit],[(_ret select 0)] call life_fnc_numberText,[(_ret select 1)] call life_fnc_numberText, _uni,_vest,_bp,_prim,_sec,_attach,_steamName,(_ret select 5),(_ret select 6),_secondary];

View File

@@ -0,0 +1,10 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminMarkers.sqf
Author: NiiRoZz
Description:
Display markers for all players
*/
if (FETCH_CONST(life_adminlevel) < 4) exitWith {closeDialog 0; hint localize "STR_ANOTF_ErrorLevel";};
[] spawn TON_fnc_MapMarkersAdmin;

View File

@@ -0,0 +1,43 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminMenu.sqf
Author: Bryan "Tonic" Boardwine
Description:
Opens the admin menu and hides buttons based on life_adminlevel.
*/
private ["_display","_list","_side","_godmode","_markers"];
if (FETCH_CONST(life_adminlevel) < 1) exitWith {closeDialog 0;};
disableSerialization;
waitUntil {!isNull (findDisplay 2900)};
_list = CONTROL(2900,2902);
if (FETCH_CONST(life_adminlevel) < 1) exitWith {closeDialog 0;};
switch (FETCH_CONST(life_adminlevel)) do
{
case 1: {ctrlShow [2904,false];ctrlShow [2905,false];ctrlShow [2906,false];ctrlShow [2907,false];ctrlShow [2908,false];ctrlShow [2909,false];ctrlShow [2910,false];ctrlShow [2911,false];};
case 2: {ctrlShow [2905,false];ctrlShow [2906,false];ctrlShow [2907,false];ctrlShow [2908,false];ctrlShow [2909,false];ctrlShow [2910,false];ctrlShow [2911,false];};
case 3: {ctrlShow [2907,false];ctrlShow [2908,false];ctrlShow [2909,false];ctrlShow [2910,false];ctrlShow [2911,false];};
case 4: {ctrlShow [2911,false];};
};
//Purge List
lbClear _list;
{
_side = switch (side _x) do {case west: {"Cop"}; case civilian: {"Civ"}; case independent: {"Medic"}; default {"Unknown"};};
_list lbAdd format ["%1 - %2", _x getVariable ["realname",name _x],_side];
_list lbSetdata [(lbSize _list)-1,str(_x)];
} forEach playableUnits;
if (FETCH_CONST(life_adminlevel) < 1) exitWith {closeDialog 0;};
if (life_god) then {
_godmode = CONTROL(2900,2908);
_godmode ctrlSetTextColor [0, 255, 0, 1]; // green
};
if (life_markers) then {
_markers = CONTROL(2900,2910);
_markers ctrlSetTextColor [0, 255, 0, 1]; // green
};

View File

@@ -0,0 +1,19 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminQuery.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the query on a player.
*/
private ["_text","_info","_prim","_sec","_vest","_uni","_bp","_attach","_tmp"];
disableSerialization;
if (!isNil "admin_query_ip") exitWith {hint localize "STR_ANOTF_Query_2"};
_text = CONTROL(2900,2903);
_info = lbData[2902,lbCurSel (2902)];
_info = call compile format ["%1", _info];
if (isNil "_info") exitWith {_text ctrlSetText localize "STR_ANOTF_QueryFail";};
if (isNull _info) exitWith {_text ctrlSetText localize "STR_ANOTF_QueryFail";};
[player] remoteExec ["TON_fnc_player_query",_info];
_text ctrlSetText localize "STR_ANOTF_Query";

View File

@@ -0,0 +1,21 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminSpectate.sqf
Author: ColinM9991
Description:
Spectate the chosen player.
*/
if (FETCH_CONST(life_adminlevel) < 3) exitWith {closeDialog 0;};
private _unit = lbData[2902,lbCurSel (2902)];
_unit = call compile format ["%1", _unit];
if (isNil "_unit") exitWith {};
if (isNull _unit) exitWith {};
if (_unit == player) exitWith {hint localize "STR_ANOTF_Error";};
closeDialog 0;
_unit switchCamera "INTERNAL";
hint format [localize "STR_NOTF_nowSpectating",_unit getVariable ["realname",name _unit]];
AM_Exit = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 68) then {(findDisplay 46) displayRemoveEventHandler ['KeyDown',AM_Exit];player switchCamera 'INTERNAL';hint 'You have stopped spectating';};false"];

View File

@@ -0,0 +1,14 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminTeleport.sqf
Author: ColinM9991
Credits: To original script author(s)
Description:
Teleport to chosen position.
*/
if (FETCH_CONST(life_adminlevel) < 3) exitWith {closeDialog 0;};
closeDialog 0;
openMap [true, false];
onMapSingleClick "[_pos select 0, _pos select 1, _pos select 2] call life_fnc_teleport";

View File

@@ -0,0 +1,18 @@
#include "..\..\script_macros.hpp"
/*
File: fn_adminTpHere.sqf
Author: ColinM9991
Description:
Teleport selected player to you.
*/
if (FETCH_CONST(life_adminlevel) < 4) exitWith {closeDialog 0;};
private _target = lbData[2902,lbCurSel (2902)];
_target = call compile format ["%1", _target];
if (isNil "_target" || isNull _target) exitWith {};
if (_target == player) exitWith {hint localize "STR_ANOTF_Error";};
if (!(vehicle _target isEqualTo _target)) exitWith {hint localize "STR_Admin_CannotTpHere"};
_target setPos (getPos player);
hint format [localize "STR_NOTF_haveTPedToYou",_target getVariable ["realname",name _target]];

View File

@@ -0,0 +1,21 @@
/*
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;

View File

@@ -0,0 +1,44 @@
/*
File: fn_civMarkers.sqf
Author:
Description:
Add markers for civilians in groups.
*/
private ["_markers","_members"];
_markers = [];
_members = [];
for "_i" from 0 to 1 step 0 do {
sleep 0.5;
if (visibleMap) then
{
_members = units (group player);
{
if !(_x isEqualTo player) then {
_marker = createMarkerLocal [format ["%1_marker",_x],visiblePosition _x];
_marker setMarkerColorLocal "ColorCivilian";
_marker setMarkerTypeLocal "Mil_dot";
_marker setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]];
_markers pushBack [_marker,_x];
};
} forEach _members;
while {visibleMap} do
{
{
private ["_unit"];
_unit = _x select 1;
if (!isNil "_unit" && !isNull _unit) then {
(_x select 0) setMarkerPosLocal (visiblePosition _unit);
};
} forEach _markers;
if (!visibleMap) exitWith {};
sleep 0.02;
};
{deleteMarkerLocal (_x select 0);} forEach _markers;
_markers = [];
_members = [];
};
};

View File

@@ -0,0 +1,27 @@
#include "..\..\script_macros.hpp"
/*
File: fn_demoChargeTimer.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the "Demo" timer for the police.
*/
private ["_uiDisp","_time","_timer"];
disableSerialization;
"lifeTimer" cutRsc ["life_timer","PLAIN"];
_uiDisp = uiNamespace getVariable "life_timer";
_timer = _uiDisp displayCtrl 38301;
_time = time + (5 * 60);
for "_i" from 0 to 1 step 0 do {
if (isNull _uiDisp) then {
"lifeTimer" cutRsc ["life_timer","PLAIN"];
_uiDisp = uiNamespace getVariable "life_timer";
_timer = _uiDisp displayCtrl 38301;
};
if (round(_time - time) < 1) exitWith {};
if (!(fed_bank getVariable ["chargeplaced",false])) exitWith {};
_timer ctrlSetText format ["%1",[(_time - time),"MM:SS.MS"] call BIS_fnc_secondsToString];
sleep 0.08;
};
"lifeTimer" cutText["","PLAIN"];

View File

@@ -0,0 +1,22 @@
#include "..\..\script_macros.hpp"
/*
File: fn_freezePlayer.sqf
Author: ColinM9991
Description:
Freezes selected player.
*/
private ["_admin"];
_admin = [_this,0,objNull,[objNull]] call BIS_fnc_param;
if (life_frozen) then {
hint localize "STR_NOTF_Unfrozen";
[1,format [localize "STR_ANOTF_Unfrozen",profileName]] remoteExecCall ["life_fnc_broadcast",_admin];
disableUserInput false;
life_frozen = false;
} else {
hint localize "STR_NOTF_Frozen";
[1,format [localize "STR_ANOTF_Frozen",profileName]] remoteExecCall ["life_fnc_broadcast",_admin];
disableUserInput true;
life_frozen = true;
};

View File

@@ -0,0 +1,62 @@
#include "..\..\script_macros.hpp"
/*
File: fn_jail.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the initial process of jailing.
*/
private ["_illegalItems"];
params [
["_unit",objNull,[objNull]],
["_bad",false,[false]]
];
if (isNull _unit) exitWith {}; //Dafuq?
if !(_unit isEqualTo player) exitWith {}; //Dafuq?
if (life_is_arrested) exitWith {}; //Dafuq i'm already arrested
_illegalItems = LIFE_SETTINGS(getArray,"jail_seize_vItems");
player setVariable ["restrained",false,true];
player setVariable ["Escorting",false,true];
player setVariable ["transporting",false,true];
titleText[localize "STR_Jail_Warn","PLAIN"];
hint localize "STR_Jail_LicenseNOTF";
player setPos (getMarkerPos "jail_marker");
if (_bad) then {
waitUntil {alive player};
sleep 1;
};
//Check to make sure they goto check
if (player distance (getMarkerPos "jail_marker") > 40) then {
player setPos (getMarkerPos "jail_marker");
};
[1] call life_fnc_removeLicenses;
{
_amount = ITEM_VALUE(_x);
if (_amount > 0) then {
[false,_x,_amount] call life_fnc_handleInv;
};
} forEach _illegalItems;
life_is_arrested = true;
if (LIFE_SETTINGS(getNumber,"jail_seize_inventory") isEqualTo 1) then {
[] spawn life_fnc_seizeClient;
} else {
removeAllWeapons player;
{player removeMagazine _x} forEach (magazines player);
};
if (life_HC_isActive) then {
[player,_bad] remoteExecCall ["HC_fnc_jailSys",HC_Life];
} else {
[player,_bad] remoteExecCall ["life_fnc_jailSys",RSERV];
};
[5] call SOCK_fnc_updatePartial;

View File

@@ -0,0 +1,105 @@
#include "..\..\script_macros.hpp"
/*
File: fn_jailMe.sqf
Author Bryan "Tonic" Boardwine
Description:
Once word is received by the server the rest of the jail execution is completed.
*/
private ["_time","_bail","_esc","_countDown"];
params [
["_ret",[],[[]]],
["_bad",false,[false]]
];
if (_bad) then { _time = time + 1100; } else { _time = time + (15 * 60); };
if (count _ret > 0) then { life_bail_amount = (_ret select 2); } else { life_bail_amount = 1500; _time = time + (10 * 60); };
_esc = false;
_bail = false;
[_bad] spawn {
life_canpay_bail = false;
if (_this select 0) then {
sleep (10 * 60);
} else {
sleep (5 * 60);
};
life_canpay_bail = true;
};
for "_i" from 0 to 1 step 0 do {
if ((round(_time - time)) > 0) then {
_countDown = [(_time - time),"MM:SS.MS"] call BIS_fnc_secondsToString;
hintSilent parseText format [(localize "STR_Jail_Time")+ "<br/> <t size='2'><t color='#FF0000'>%1</t></t><br/><br/>" +(localize "STR_Jail_Pay")+ " %3<br/>" +(localize "STR_Jail_Price")+ " $%2",_countDown,[life_bail_amount] call life_fnc_numberText,if (life_canpay_bail) then {"Yes"} else {"No"}];
};
if (LIFE_SETTINGS(getNumber,"jail_forceWalk") isEqualTo 1) then {
player forceWalk true;
};
private _escDist = [[["Altis", 60], ["Tanoa", 145]]] call TON_fnc_terrainSort;
if (player distance (getMarkerPos "jail_marker") > _escDist) exitWith {
_esc = true;
};
if (life_bail_paid) exitWith {
_bail = true;
};
if ((round(_time - time)) < 1) exitWith {hint ""};
if (!alive player && ((round(_time - time)) > 0)) exitWith {};
sleep 0.1;
};
switch (true) do {
case (_bail): {
life_is_arrested = false;
life_bail_paid = false;
hint localize "STR_Jail_Paid";
player setPos (getMarkerPos "jail_release");
if (life_HC_isActive) then {
[getPlayerUID player] remoteExecCall ["HC_fnc_wantedRemove",HC_Life];
} else {
[getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV];
};
[5] call SOCK_fnc_updatePartial;
};
case (_esc): {
life_is_arrested = false;
hint localize "STR_Jail_EscapeSelf";
[0,"STR_Jail_EscapeNOTF",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
if (life_HC_isActive) then {
[getPlayerUID player,profileName,"901"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
} else {
[getPlayerUID player,profileName,"901"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
};
[5] call SOCK_fnc_updatePartial;
};
case (alive player && !_esc && !_bail): {
life_is_arrested = false;
hint localize "STR_Jail_Released";
if (life_HC_isActive) then {
[getPlayerUID player] remoteExecCall ["HC_fnc_wantedRemove",HC_Life];
} else {
[getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV];
};
player setPos (getMarkerPos "jail_release");
[5] call SOCK_fnc_updatePartial;
};
};
player forceWalk false; // Enable running & jumping

View File

@@ -0,0 +1,34 @@
#include "..\..\script_macros.hpp"
/*
File: fn_knockedOut.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts and monitors the knocked out state.
*/
private "_obj";
params [
["_target",objNull,[objNull]],
["_who","",[""]]
];
if (isNull _target) exitWith {};
if !(_target isEqualTo player) exitWith {};
if (_who isEqualTo "") exitWith {};
titleText[format [localize "STR_Civ_KnockedOut",_who],"PLAIN"];
player playMoveNow "Incapacitated";
disableUserInput true;
_obj = "Land_ClutterCutter_small_F" createVehicle ASLTOATL(visiblePositionASL player);
_obj setPosATL ASLTOATL(visiblePositionASL player);
life_isknocked = true;
player attachTo [_obj,[0,0,0]];
sleep 15;
player playMoveNow "AmovPpneMstpSrasWrflDnon";
disableUserInput false;
detach player;
deleteVehicle _obj;
life_isknocked = false;
player setVariable ["robbed",false,true];

View File

@@ -0,0 +1,22 @@
#include "..\..\script_macros.hpp"
/*
File: fn_knockoutAction.sqf
Author: Bryan "Tonic" Boardwine
Description:
Knocks out the target.
*/
private "_target";
_target = param [0,objNull,[objNull]];
//Error checks
if (isNull _target) exitWith {};
if (!isPlayer _target) exitWith {};
if (player distance _target > 4) exitWith {};
life_knockout = true;
[player,"AwopPercMstpSgthWrflDnon_End2"] remoteExecCall ["life_fnc_animSync",RCLIENT];
sleep 0.08;
[_target,profileName] remoteExec ["life_fnc_knockedOut",_target];
sleep 3;
life_knockout = false;

View File

@@ -0,0 +1,47 @@
#include "..\..\script_macros.hpp"
/*
File: fn_removeLicenses.sqf
Author: Bryan "Tonic" Boardwine
Description:
Used for stripping certain licenses off of civilians as punishment.
*/
private "_state";
_state = param [0,1,[0]];
switch (_state) do {
//Death while being wanted
case 0: {
missionNamespace setVariable [LICENSE_VARNAME("rebel","civ"),false];
missionNamespace setVariable [LICENSE_VARNAME("driver","civ"),false];
missionNamespace setVariable [LICENSE_VARNAME("heroin","civ"),false];
missionNamespace setVariable [LICENSE_VARNAME("marijuana","civ"),false];
missionNamespace setVariable [LICENSE_VARNAME("cocaine","civ"),false];
};
//Jail licenses
case 1: {
missionNamespace setVariable [LICENSE_VARNAME("gun","civ"),false];
missionNamespace setVariable [LICENSE_VARNAME("driver","civ"),false];
missionNamespace setVariable [LICENSE_VARNAME("rebel","civ"),false];
};
//Remove motor vehicle licenses
case 2: {
if (missionNamespace getVariable LICENSE_VARNAME("driver","civ") || missionNamespace getVariable LICENSE_VARNAME("pilot","civ") || missionNamespace getVariable LICENSE_VARNAME("trucking","civ") || missionNamespace getVariable LICENSE_VARNAME("boat","civ")) then {
missionNamespace setVariable [LICENSE_VARNAME("pilot","civ"),false];
missionNamespace setVariable [LICENSE_VARNAME("driver","civ"),false];
missionNamespace setVariable [LICENSE_VARNAME("trucking","civ"),false];
missionNamespace setVariable [LICENSE_VARNAME("boat","civ"),false];
hint localize "STR_Civ_LicenseRemove_1";
};
};
//Killing someone while owning a gun license
case 3: {
if (missionNamespace getVariable LICENSE_VARNAME("gun","civ")) then {
missionNamespace setVariable [LICENSE_VARNAME("gun","civ"),false];
hint localize "STR_Civ_LicenseRemove_2";
};
};
};

View File

@@ -0,0 +1,28 @@
#include "..\..\script_macros.hpp"
/*
File: fn_robPerson.sqf
Author: Bryan "Tonic" Boardwine
Description:
Robs a person.
*/
params [
["_robber",objNull,[objNull]]
];
if (isNull _robber) exitWith {}; //No one to return it to?
if (CASH > 0) then {
[CASH,player,_robber] remoteExecCall ["life_fnc_robReceive",_robber];
if (life_HC_isActive) then {
[getPlayerUID _robber,_robber getVariable ["realname",name _robber],"211"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
} else {
[getPlayerUID _robber,_robber getVariable ["realname",name _robber],"211"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
};
[1,"STR_NOTF_Robbed",true,[_robber getVariable ["realname",name _robber],profileName,[CASH] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
CASH = 0;
[0] call SOCK_fnc_updatePartial;
} else {
[2,"STR_NOTF_RobFail",true,[profileName]] remoteExecCall ["life_fnc_broadcast",_robber];
};

View File

@@ -0,0 +1,29 @@
#include "..\..\script_macros.hpp"
/*
File: fn_robReceive.sqf
Author: Bryan "Tonic" Boardwine
Description:
*/
params [
["_cash",0,[0]],
["_victim",objNull,[objNull]],
["_robber",objNull,[objNull]]
];
if (_robber == _victim) exitWith {};
if (_cash isEqualTo 0) exitWith {titleText[localize "STR_Civ_RobFail","PLAIN"]};
CASH = CASH + _cash;
[0] call SOCK_fnc_updatePartial;
titleText[format [localize "STR_Civ_Robbed",[_cash] call life_fnc_numberText],"PLAIN"];
if (LIFE_SETTINGS(getNumber,"player_moneyLog") isEqualTo 1) then {
if (LIFE_SETTINGS(getNumber,"battlEye_friendlyLogging") isEqualTo 1) then {
money_log = format [localize "STR_DL_ML_Robbed_BEF",[_cash] call life_fnc_numberText,_victim,[BANK] call life_fnc_numberText,[CASH] call life_fnc_numberText];
} else {
money_log = format [localize "STR_DL_ML_Robbed",profileName,(getPlayerUID player),[_cash] call life_fnc_numberText,_victim,[BANK] call life_fnc_numberText,[CASH] call life_fnc_numberText];
};
publicVariableServer "money_log";
};

View File

@@ -0,0 +1,58 @@
#include "..\..\script_macros.hpp"
/*
File: fn_tazed.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the tazed animation and broadcasts out what it needs to.
*/
private ["_curWep","_curMags","_attach"];
params [
["_unit",objNull,[objNull]],
["_shooter",objNull,[objNull]]
];
if (isNull _unit || isNull _shooter) exitWith {player allowDamage true; life_istazed = false;};
if (_shooter isKindOf "Man" && alive player) then {
if (!life_istazed) then {
life_istazed = true;
_curWep = currentWeapon player;
_curMags = magazines player;
_attach = if (!(primaryWeapon player isEqualTo "")) then {primaryWeaponItems player} else {[]};
{player removeMagazine _x} forEach _curMags;
player removeWeapon _curWep;
player addWeapon _curWep;
if (!(count _attach isEqualTo 0) && !(primaryWeapon player isEqualTo "")) then {
{
_unit addPrimaryWeaponItem _x;
} forEach _attach;
};
if (!(count _curMags isEqualTo 0)) then {
{player addMagazine _x;} forEach _curMags;
};
[_unit] remoteExecCall ["life_fnc_tazeSound",RCLIENT];
_obj = "Land_ClutterCutter_small_F" createVehicle ASLTOATL(visiblePositionASL player);
_obj setPosATL ASLTOATL(visiblePositionASL player);
[player,"AinjPfalMstpSnonWnonDf_carried_fallwc"] remoteExecCall ["life_fnc_animSync",RCLIENT];
[0,"STR_NOTF_Tazed",true,[profileName, _shooter getVariable ["realname",name _shooter]]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
_unit attachTo [_obj,[0,0,0]];
disableUserInput true;
sleep 15;
[player,"AmovPpneMstpSrasWrflDnon"] remoteExecCall ["life_fnc_animSync",RCLIENT];
if (!(player getVariable ["Escorting",false])) then {
detach player;
};
life_istazed = false;
player allowDamage true;
disableUserInput false;
};
} else {
_unit allowDamage true;
life_iztazed = false;
};

View File

@@ -0,0 +1,25 @@
#include "..\script_macros.hpp"
/*
File: clientValidator.sqf
Author:
Description:
Loops through a list of variables and checks whether
or not they are defined, if they are defined then trigger
spyglass and kick the client to the lobby.
*/
private ["_vars"];
_vars = [
"life_revive_fee","life_gangPrice","life_gangUpgradeBase","life_enableFatigue","life_paycheck_period","life_vShop_rentalOnly","sell_array","buy_array",
"life_weapon_shop_array","life_garage_prices","life_garage_sell","life_houseLimit","life_gangUpgradeMultipler","life_impound_car","life_impound_boat",
"life_impound_air"
];
{
if (!isNil {(missionNamespace getVariable _x)}) exitWith {
[profileName,getPlayerUID player,format ["VariableSetBeforeInitialized_%1",_x]] remoteExecCall ["SPY_fnc_cookieJar",RSERV];
[profileName,format ["Variable set before client initialized: %1",_x]] remoteExecCall ["SPY_fnc_notifyAdmins",RCLIENT];
sleep 0.5;
failMission "SpyGlass";
};
} forEach _vars;

View File

@@ -0,0 +1,25 @@
/*
File: fn_houseConfig.sqf
Author: BoGuu
Description:
Fetch data from Config_Housing/Garages
*/
private _house = param [0,"",[""]];
if (_house isEqualTo "") exitWith {[]};
private _houseConfig = missionConfigFile >> "Housing" >> worldName >> _house;
private _garageConfig = missionConfigFile >> "Garages" >> worldName >> _house;
private _config = [_garageConfig,_houseConfig] select {isClass _x};
if (_config isEqualTo []) exitWith {[]};
_config = _config select 0;
private _price = getNumber(_config >> "price");
private _numberCrates = if (_houseConfig isEqualTo _config) then {getNumber(_houseConfig >> "numberCrates")} else {0};
//Return
[_price,_numberCrates]

View File

@@ -0,0 +1,13 @@
#include "..\..\script_macros.hpp"
/*
File: fn_itemWeight.sqf
Author: Bryan "Tonic" Boardwine
Description:
Gets the items weight and returns it.
*/
private ["_item"];
_item = [_this,0,"",[""]] call BIS_fnc_param;
if (_item isEqualTo "") exitWith {};
M_CONFIG(getNumber,"VirtualItems",_item,"weight");

View File

@@ -0,0 +1,62 @@
/*
File: fn_vehicleAnimate.sqf
Author: Bryan "Tonic" Boardwine
Description:
Pass what you want to be animated.
*/
private ["_vehicle","_animate","_state"];
_vehicle = [_this,0,objNull,[objNull]] call BIS_fnc_param;
if (isNull _vehicle) exitWith {}; //FUCK
_animate = [_this,1,"",["",[]]] call BIS_fnc_param;
_preset = [_this,2,false,[false]] call BIS_fnc_param;
if (!_preset) then
{
if (count _animate > 1) then
{
{
_vehicle animate[_x select 0,_x select 1];
} forEach _animate;
}
else
{
_vehicle animate[_animate select 0,_animate select 1];
};
}
else
{
switch (_animate) do
{
case "civ_littlebird":
{
_vehicle animate ["addDoors",1];
_vehicle animate ["addBenches",0];
_vehicle animate ["addTread",0];
_vehicle animate ["AddCivilian_hide",1];
_vehicle lockCargo [2,true];
_vehicle lockCargo [3,true];
_vehicle lockCargo [4,true];
_vehicle lockCargo [5,true];
};
case "service_truck":
{
_vehicle animate ["HideServices", 0];
_vehicle animate ["HideDoor3", 1];
};
case "med_offroad":
{
_vehicle animate ["HidePolice", 0];
_vehicle setVariable ["lights",false,true];
};
case "cop_offroad":
{
_vehicle animate ["HidePolice", 0];
_vehicle animate ["HideBumper1", 0];
_vehicle setVariable ["lights",false,true];
};
};
};

View File

@@ -0,0 +1,19 @@
#include "..\..\script_macros.hpp"
/*
File: fn_vehicleWeightCfg.sqf
Author: Bryan "Tonic" Boardwine
Description:
Master configuration for vehicle weight.
*/
private ["_className","_classNameLife","_weight"];
_className = [_this,0,"",[""]] call BIS_fnc_param;
_classNameLife = _className;
if (!isClass (missionConfigFile >> "LifeCfgVehicles" >> _classNameLife)) then {
_classNameLife = "Default"; //Use Default class if it doesn't exist
diag_log format ["%1: LifeCfgVehicles class doesn't exist",_className];
};
_weight = M_CONFIG(getNumber,"LifeCfgVehicles",_classNameLife,"vItemSpace");
if (isNil "_weight") then {_weight = -1;};
_weight;

View File

@@ -0,0 +1,103 @@
#include "..\script_macros.hpp"
/*
File: configuration.sqf
Author:
Description:
Master Life Configuration File
This file is to setup variables for the client, there are still other configuration files in the system
*****************************
****** Backend Variables *****
*****************************
*/
life_query_time = time;
life_action_delay = time;
life_trunk_vehicle = objNull;
life_session_completed = false;
life_garage_store = false;
life_session_tries = 0;
life_net_dropped = false;
life_siren_active = false;
life_clothing_filter = 0;
life_clothing_uniform = -1;
life_redgull_effect = time;
life_is_processing = false;
life_bail_paid = false;
life_impound_inuse = false;
life_action_inUse = false;
life_spikestrip = objNull;
life_knockout = false;
life_interrupted = false;
life_respawned = false;
life_removeWanted = false;
life_action_gathering = false;
tawvd_addon_disable = true;
life_god = false;
life_frozen = false;
life_save_gear = [];
life_container_activeObj = objNull;
life_disable_getIn = false;
life_disable_getOut = false;
life_admin_debug = false;
life_preview_3D_vehicle_cam = objNull;
life_preview_3D_vehicle_object = objNull;
life_preview_light = objNull;
life_pos_exist = false;
life_pos_attach = [];
life_civ_position = [];
life_markers = false;
life_canpay_bail = true;
//Settings
life_settings_enableNewsBroadcast = profileNamespace getVariable ["life_enableNewsBroadcast",true];
life_settings_enableSidechannel = profileNamespace getVariable ["life_enableSidechannel",true];
life_settings_tagson = profileNamespace getVariable ["life_settings_tagson",true];
life_settings_revealObjects = profileNamespace getVariable ["life_settings_revealObjects",true];
life_settings_viewDistanceFoot = profileNamespace getVariable ["life_viewDistanceFoot",1250];
life_settings_viewDistanceCar = profileNamespace getVariable ["life_viewDistanceCar",1250];
life_settings_viewDistanceAir = profileNamespace getVariable ["life_viewDistanceAir",1250];
//Uniform price (0),Hat Price (1),Glasses Price (2),Vest Price (3),Backpack Price (4)
life_clothing_purchase = [-1,-1,-1,-1,-1];
/*
*****************************
****** Weight Variables *****
*****************************
*/
life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight");
life_carryWeight = 0; //Represents the players current inventory weight (MUST START AT 0).
/*
*****************************
****** Life Variables *******
*****************************
*/
life_net_dropped = false;
life_use_atm = true;
life_is_arrested = false;
life_is_alive = false;
life_delivery_in_progress = false;
life_thirst = 100;
life_hunger = 100;
CASH = 0;
life_istazed = false;
life_isknocked = false;
life_vehicles = [];
/*
Master Array of items?
*/
//Setup variable inv vars.
{
missionNamespace setVariable [ITEM_VARNAME(configName _x),0];
} forEach ("true" configClasses (missionConfigFile >> "VirtualItems"));
/* Setup the BLAH! */
{
_varName = getText(_x >> "variable");
_sideFlag = getText(_x >> "side");
missionNamespace setVariable [LICENSE_VARNAME(_varName,_sideFlag),false];
} forEach ("true" configClasses (missionConfigFile >> "Licenses"));

View File

@@ -0,0 +1,20 @@
#include "..\..\script_macros.hpp"
/*
File: fn_bountyReceive.sqf
Author: Bryan "Tonic" Boardwine
Description:
Notifies the player he has received a bounty and gives him the cash.
*/
private ["_val","_total"];
_val = [_this,0,"",["",0]] call BIS_fnc_param;
_total = [_this,1,"",["",0]] call BIS_fnc_param;
if (_val == _total) then {
titleText[format [localize "STR_Cop_BountyRecieve",[_val] call life_fnc_numberText],"PLAIN"];
} else {
titleText[format [localize "STR_Cop_BountyKill",[_val] call life_fnc_numberText,[_total] call life_fnc_numberText],"PLAIN"];
};
BANK = BANK + _val;
[1] call SOCK_fnc_updatePartial;

View File

@@ -0,0 +1,42 @@
#include "..\..\script_macros.hpp"
/*
File: fn_containerInvSearch.sqf
Author: NiiRoZz
Inspired : Bryan "Tonic" Boardwine
Description:
Searches the container for illegal items.
*/
private ["_container","_containerInfo","_value"];
_container = [_this,0,objNull,[objNull]] call BIS_fnc_param;
if (isNull _container) exitWith {};
_containerInfo = _container getVariable ["Trunk",[]];
if (count _containerInfo isEqualTo 0) exitWith {hint localize "STR_Cop_ContainerEmpty"};
_value = 0;
_illegalValue = 0;
{
_var = _x select 0;
_val = _x select 1;
_isIllegalItem = M_CONFIG(getNumber,"VirtualItems",_var,"illegal");
if (_isIllegalItem isEqualTo 1 ) then {
_illegalPrice = M_CONFIG(getNumber,"VirtualItems",_var,"sellPrice");
if (!isNull (missionConfigFile >> "VirtualItems" >> _var >> "processedItem")) then {
_illegalItemProcessed = M_CONFIG(getText,"VirtualItems",_var,"processedItem");
_illegalPrice = M_CONFIG(getNumber,"VirtualItems",_illegalItemProcessed,"sellPrice");
};
_illegalValue = _illegalValue + (round(_val * _illegalPrice / 2));
};
} forEach (_containerInfo select 0);
_value = _illegalValue;
if (_value > 0) then {
[0,"STR_NOTF_ContainerContraband",true,[[_value] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
BANK = BANK + _value;
[1] call SOCK_fnc_updatePartial;
_container setVariable ["Trunk",[[],0],true];
[_container] remoteExecCall ["TON_fnc_updateHouseTrunk",2];
} else {
hint localize "STR_Cop_NoIllegalContainer";
};

View File

@@ -0,0 +1,90 @@
#include "..\..\script_macros.hpp"
/*
File: fn_copInteractionMenu.sqf
Author: Bryan "Tonic" Boardwine
Description:
Replaces the mass addactions for various cop actions towards another player.
*/
#define Btn1 37450
#define Btn2 37451
#define Btn3 37452
#define Btn4 37453
#define Btn5 37454
#define Btn6 37455
#define Btn7 37456
#define Btn8 37457
#define Title 37401
private ["_display","_curTarget","_seizeRank","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_Btn7","_Btn8"];
disableSerialization;
_curTarget = param [0,objNull,[objNull]];
_seizeRank = LIFE_SETTINGS(getNumber,"seize_minimum_rank");
if (player getVariable ["Escorting", false]) then {
if (isNull _curTarget) exitWith {closeDialog 0;}; //Bad target
if (!isPlayer _curTarget && side _curTarget isEqualTo civilian) exitWith {closeDialog 0;}; //Bad side check?
if (player distance _curTarget > 4 ) exitWith {closeDialog 0;}; // Prevents menu accessing from far distances.
};
if (!dialog) then {
createDialog "pInteraction_Menu";
};
_display = findDisplay 37400;
_Btn1 = _display displayCtrl Btn1;
_Btn2 = _display displayCtrl Btn2;
_Btn3 = _display displayCtrl Btn3;
_Btn4 = _display displayCtrl Btn4;
_Btn5 = _display displayCtrl Btn5;
_Btn6 = _display displayCtrl Btn6;
_Btn7 = _display displayCtrl Btn7;
_Btn8 = _display displayCtrl Btn8;
life_pInact_curTarget = _curTarget;
if (player getVariable ["isEscorting",false]) then {
{ _x ctrlShow false; } forEach [_Btn1,_Btn2,_Btn3,_Btn5,_Btn6,_Btn7,_Btn8];
};
//Set Unrestrain Button
_Btn1 ctrlSetText localize "STR_pInAct_Unrestrain";
_Btn1 buttonSetAction "[life_pInact_curTarget] call life_fnc_unrestrain; closeDialog 0;";
//Set Check Licenses Button
_Btn2 ctrlSetText localize "STR_pInAct_checkLicenses";
_Btn2 buttonSetAction "[player] remoteExecCall [""life_fnc_licenseCheck"",life_pInact_curTarget]; closeDialog 0;";
//Set Search Button
_Btn3 ctrlSetText localize "STR_pInAct_SearchPlayer";
_Btn3 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_searchAction; closeDialog 0;";
//Set Escort Button
if (player getVariable ["isEscorting",false]) then {
_Btn4 ctrlSetText localize "STR_pInAct_StopEscort";
_Btn4 buttonSetAction "[] call life_fnc_stopEscorting; closeDialog 0;";
} else {
_Btn4 ctrlSetText localize "STR_pInAct_Escort";
_Btn4 buttonSetAction "[life_pInact_curTarget] call life_fnc_escortAction; closeDialog 0;";
};
//Set Ticket Button
_Btn5 ctrlSetText localize "STR_pInAct_TicketBtn";
_Btn5 buttonSetAction "[life_pInact_curTarget] call life_fnc_ticketAction;";
_Btn6 ctrlSetText localize "STR_pInAct_Arrest";
_Btn6 buttonSetAction "[life_pInact_curTarget] call life_fnc_arrestAction; closeDialog 0;";
_Btn6 ctrlEnable false;
_Btn7 ctrlSetText localize "STR_pInAct_PutInCar";
_Btn7 buttonSetAction "[life_pInact_curTarget] call life_fnc_putInCar; closeDialog 0;";
//SeizeWeapons Button
_Btn8 ctrlSetText localize "STR_pInAct_Seize";
_Btn8 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_seizePlayerAction; closeDialog 0;";
if (FETCH_CONST(life_coplevel) < _seizeRank) then {_Btn8 ctrlEnable false;};
{
if ((player distance (getMarkerPos _x) <30)) exitWith { _Btn6 ctrlEnable true;};
} forEach LIFE_SETTINGS(getArray,"sendtoJail_locations");

View File

@@ -0,0 +1,131 @@
/*
File: fn_copLights.sqf
Author: mindstorm, modified by Adanteh
Link: http://forums.bistudio.com/showthread.php?157474-Offroad-Police-sirens-lights-and-underglow
Description:
Adds the light effect to cop vehicles, specifically the offroad.
*/
Private ["_vehicle","_lightRed","_lightBlue","_lightleft","_lightright","_leftRed"];
_vehicle = _this select 0;
if (isNil "_vehicle" || isNull _vehicle || !(_vehicle getVariable "lights")) exitWith {};
_lightRed = [20, 0.1, 0.1];
_lightBlue = [0.1, 0.1, 20];
_lightleft = "#lightpoint" createVehicle getPos _vehicle;
sleep 0.2;
_lightleft setLightColor _lightRed;
_lightleft setLightBrightness 0.2;
_lightleft setLightAmbient [0.1,0.1,1];
switch (typeOf _vehicle) do
{
case "C_Offroad_01_F":
{
_lightleft lightAttachObject [_vehicle, [-0.37, 0.0, 0.56]];
};
case "B_MRAP_01_F":
{
_lightleft lightAttachObject [_vehicle, [-0.37, -1.9, 0.7]];
};
case "C_SUV_01_F":
{
_lightleft lightAttachObject [_vehicle, [-0.37,-1.2,0.42]];
};
case "C_Hatchback_01_sport_F":
{
_lightleft lightAttachObject [_vehicle, [-0.35,-0.2,0.25]];
};
case "B_Heli_Light_01_F":
{
_lightleft lightAttachObject [_vehicle,[-0.37, 0.0, -0.80]];
};
case "B_Heli_Transport_01_F":
{
_lightleft lightAttachObject [_vehicle, [-0.5, 0.0, 0.81]];
};
};
_lightleft setLightAttenuation [0.181, 0, 1000, 130];
_lightleft setLightIntensity 10;
_lightleft setLightFlareSize 0.38;
_lightleft setLightFlareMaxDistance 150;
_lightleft setLightUseFlare true;
_lightright = "#lightpoint" createVehicle getPos _vehicle;
sleep 0.2;
_lightright setLightColor _lightBlue;
_lightright setLightBrightness 0.2;
_lightright setLightAmbient [0.1,0.1,1];
switch (typeOf _vehicle) do
{
case "C_Offroad_01_F":
{
_lightright lightAttachObject [_vehicle, [0.37, 0.0, 0.56]];
};
case "B_MRAP_01_F":
{
_lightright lightAttachObject [_vehicle, [0.37, -1.9, 0.7]];
};
case "C_SUV_01_F":
{
_lightright lightAttachObject [_vehicle, [0.37,-1.2,0.42]];
};
case "C_Hatchback_01_sport_F":
{
_lightright lightAttachObject [_vehicle, [0.35,-0.2,0.25]];
};
case "B_Heli_Light_01_F":
{
_lightright lightAttachObject [_vehicle,[0.37, 0.0, -0.80]];
};
case "B_Heli_Transport_01_F":
{
_lightright lightAttachObject [_vehicle, [0.5, 0.0, 0.81]];
};
};
_lightright setLightAttenuation [0.181, 0, 1000, 130];
_lightright setLightIntensity 10;
_lightright setLightFlareSize 0.38;
_lightright setLightFlareMaxDistance 150;
_lightright setLightUseFlare true;
//ARE YOU ALL HAPPY?!?!?!?!?!?!?!?!?%#?@WGD?TGD?BN?ZDHBFD?GA
_lightleft setLightDayLight true;
_lightright setLightDayLight true;
_leftRed = true;
while{ (alive _vehicle)} do
{
if (!(_vehicle getVariable "lights")) exitWith {};
if (_leftRed) then
{
_leftRed = false;
_lightright setLightBrightness 0.0;
sleep 0.05;
_lightleft setLightBrightness 6;
}
else
{
_leftRed = true;
_lightleft setLightBrightness 0.0;
sleep 0.05;
_lightright setLightBrightness 6;
};
sleep (_this select 1);
};
deleteVehicle _lightleft;
deleteVehicle _lightright;

View File

@@ -0,0 +1,32 @@
/*
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;

View File

@@ -0,0 +1,43 @@
/*
File: fn_copMarkers.sqf
Author: Bryan "Tonic" Boardwine
Description:
Marks cops on the map for other cops. Only initializes when the actual map is open.
*/
private ["_markers","_cops"];
_markers = [];
_cops = [];
sleep 0.5;
if (visibleMap) then {
{if (side _x isEqualTo west) then {_cops pushBack _x;}} forEach playableUnits; //Fetch list of cops / blufor
//Create markers
{
if !(_x isEqualTo player) then {
_marker = createMarkerLocal [format ["%1_marker",_x],visiblePosition _x];
_marker setMarkerColorLocal "ColorBLUFOR";
_marker setMarkerTypeLocal "Mil_dot";
_marker setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]];
_markers pushBack [_marker,_x];
};
} forEach _cops;
while {visibleMap} do {
{
private ["_unit"];
_unit = _x select 1;
if (!isNil "_unit" && !isNull _unit) then {
(_x select 0) setMarkerPosLocal (visiblePosition _unit);
};
} forEach _markers;
if (!visibleMap) exitWith {};
sleep 0.02;
};
{deleteMarkerLocal (_x select 0);} forEach _markers;
_markers = [];
_cops = [];
};

View File

@@ -0,0 +1,63 @@
#include "..\..\script_macros.hpp"
/*
File: fn_copSearch.sqf
Author: Bryan "Tonic" Boardwine
Description:
Returns information on the search.
*/
life_action_inUse = false;
private ["_license","_guns","_gun"];
params [
["_civ",objNull,[objNull]],
["_invs",[],[[]]],
["_robber",false,[false]]
];
if (isNull _civ) exitWith {};
_illegal = 0;
_inv = "";
if (count _invs > 0) then {
{
_displayName = M_CONFIG(getText,"VirtualItems",(_x select 0),"displayName");
_inv = _inv + format ["%1 %2<br/>",(_x select 1),(localize _displayName)];
_price = M_CONFIG(getNumber,"VirtualItems",(_x select 0),"sellPrice");
if (!isNull (missionConfigFile >> "VirtualItems" >> (_x select 0) >> "processedItem")) then {
_processed = M_CONFIG(getText,"VirtualItems",(_x select 0),"processedItem");
_price = M_CONFIG(getNumber,"VirtualItems",_processed,"sellPrice");
};
if (!(_price isEqualTo -1)) then {
_illegal = _illegal + ((_x select 1) * _price);
};
} forEach _invs;
if (_illegal > 6000) then {
if (life_HC_isActive) then {
[getPlayerUID _civ,_civ getVariable ["realname",name _civ],"482"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
} else {
[getPlayerUID _civ,_civ getVariable ["realname",name _civ],"482"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
};
};
if (life_HC_isActive) then {
[getPlayerUID _civ,_civ getVariable ["realname",name _civ],"481"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
} else {
[getPlayerUID _civ,_civ getVariable ["realname",name _civ],"481"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
};
[0,"STR_Cop_Contraband",true,[(_civ getVariable ["realname",name _civ]),[_illegal] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",west];
} else {
_inv = localize "STR_Cop_NoIllegal";
};
if (!alive _civ || player distance _civ > 5) exitWith {hint format [localize "STR_Cop_CouldntSearch",_civ getVariable ["realname",name _civ]]};
//hint format ["%1",_this];
hint parseText format ["<t color='#FF0000'><t size='2'>%1</t></t><br/><t color='#FFD700'><t size='1.5'><br/>" +(localize "STR_Cop_IllegalItems")+ "</t></t><br/>%2<br/><br/><br/><br/><t color='#FF0000'>%3</t>"
,(_civ getVariable ["realname",name _civ]),_inv,if (_robber) then {"Robbed the bank"} else {""}];
if (_robber) then {
[0,"STR_Cop_Robber",true,[(_civ getVariable ["realname",name _civ])]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
};

View File

@@ -0,0 +1,23 @@
#include "..\..\script_macros.hpp"
/*
File: fn_copSiren.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the cop siren sound for other players.
*/
private ["_vehicle"];
_vehicle = param [0,objNull,[objNull]];
if (isNull _vehicle) exitWith {};
if (isNil {_vehicle getVariable "siren"}) exitWith {};
for "_i" from 0 to 1 step 0 do {
if (!(_vehicle getVariable "siren")) exitWith {};
if (count crew _vehicle isEqualTo 0) then {_vehicle setVariable ["siren",false,true]};
if (!alive _vehicle) exitWith {};
if (isNull _vehicle) exitWith {};
_vehicle say3D "sirenLong";//Class name specified in description.ext
sleep 4.870;//Exactly matches the length of the audio file.
if (!(_vehicle getVariable "siren")) exitWith {};
};

View File

@@ -0,0 +1,29 @@
#include "..\..\script_macros.hpp"
/*
File: fn_doorAnimate.sqf
Author: Bryan "Tonic" Boardwine
Description:
Animates a door?
*/
private ["_b","_doors","_door"];
_b = _this select 0;
_doors = 1;
_doors = FETCH_CONFIG2(getNumber,"CfgVehicles",typeOf _b,"NumberOfDoors");
_door = 0;
//Find the nearest door
for "_i" from 1 to _doors do {
_selPos = _b selectionPosition format ["Door_%1_trigger",_i];
_worldSpace = _b modelToWorld _selPos;
if (player distance _worldSpace < 5) exitWith {_door = _i;};
};
if (_door isEqualTo 0) exitWith {hint localize "STR_Cop_NotaDoor"}; //Not near a door to be broken into.
if (_b animationPhase format ["door_%1_rot",_door] isEqualTo 0) then {
_b animateSource [format ["Door_%1_source", _door], 1];
} else {
_b animateSource [format ["Door_%1_source", _door], 0];
};
closeDialog 0;

View File

@@ -0,0 +1,53 @@
#include "..\..\script_macros.hpp"
/*
File: fn_fedCamDisplay.sqf
Author: Bryan "Tonic" Boardwine
Description:
Turns on and displays a security cam like feed via PiP to the laptop display.
*/
params [
"_laptop",
"",
"",
"_mode"
];
private _altisArray = [16019.5,16952.9,0];
private _tanoaArray = [11074.2,11501.5,0.00137329];
private _pos = [[["Altis", _altisArray], ["Tanoa", _tanoaArray]]] call TON_fnc_terrainSort;
private _dome = nearestObject [_pos,"Land_Dome_Big_F"];
if (!isPiPEnabled) exitWith {hint localize "STR_Cop_EnablePiP";};
if (isNil "life_fed_scam") then {
life_fed_scam = "camera" camCreate [0,0,0];
life_fed_scam camSetFov 0.5;
life_fed_scam camCommit 0;
"rendertarget0" setPiPEffect [0];
life_fed_scam cameraEffect ["INTERNAL", "BACK", "rendertarget0"];
_laptop setObjectTexture [0,"#(argb,256,256,1)r2t(rendertarget0,1.0)"];
};
private _mTwPositions = [
["side",[16.9434,-0.300781,-7.20004],[27.0693,-0.390625,-10.2474]],
["vault",[19.9775,-0.0078125,-1.90735e-006],[-5.00684,0.59375,-9.57164]],
["front",[0.972656,78.8281,15.617],[-0.657227,22.9082,-10.4033]],
["back",[28.9248,-42.0977,-3.8896],[-1.33789,-24.6035,-10.2108]]
];
private _index = [_mode,_mTwPositions] call TON_fnc_index;
if (_index isEqualTo -1) then {
//Turn off
life_fed_scam cameraEffect ["terminate", "back"];
camDestroy life_fed_scam;
_laptop setObjectTexture [0,""];
life_fed_scam = nil;
} else {
_temp = _mTwPositions select _index;
life_fed_scam camSetPos (_dome modelToWorld (_temp select 1));
life_fed_scam camSetTarget (_dome modelToWorld (_temp select 2));
life_fed_scam camCommit 0;
};

View File

@@ -0,0 +1,25 @@
#include "..\..\script_macros.hpp"
/*
File: fn_licenseCheck.sqf
Author: Bryan "Tonic" Boardwine
Description:
Returns the licenses to the cop.
*/
private ["_cop","_licenses","_licensesConfigs"];
_cop = param [0,objNull,[objNull]];
if (isNull _cop) exitWith {}; //Bad entry
_licenses = "";
//Config entries for licenses that are civilian
_licensesConfigs = "getText(_x >> 'side') isEqualTo 'civ'" configClasses (missionConfigFile >> "Licenses");
{
if (LICENSE_VALUE(configName _x,"civ")) then {
_licenses = _licenses + localize getText(_x >> "displayName") + "<br/>";
};
} forEach _licensesConfigs;
if (_licenses isEqualTo "") then {_licenses = (localize "STR_Cop_NoLicensesFound");};
[profileName,_licenses] remoteExecCall ["life_fnc_licensesRead",_cop];

View File

@@ -0,0 +1,13 @@
/*
File: fn_licensesRead.sqf
Author: Bryan "Tonic" Boardwine
Description:
Outprints the licenses.
*/
params [
["_civ","",[""]],
["_licenses",(localize "STR_Cop_NoLicenses"),[""]]
];
hint parseText format ["<t color='#FF0000'><t size='2'>%1</t></t><br/><t color='#FFD700'><t size='1.5'>" +(localize "STR_Cop_Licenses")+ "</t></t><br/>%2",_civ,_licenses];

View File

@@ -0,0 +1,33 @@
#include "..\..\script_macros.hpp"
/*
File: fn_questionDealer.sqf
Author: Bryan "Tonic" Boardwine
Description:
Questions the drug dealer and sets the sellers wanted.
*/
private ["_sellers","_crimes","_names"];
_sellers = (_this select 0) getVariable ["sellers",[]];
if (count _sellers isEqualTo 0) exitWith {hint localize "STR_Cop_DealerQuestion"}; //No data.
life_action_inUse = true;
_crimes = LIFE_SETTINGS(getArray,"crimes");
_names = "";
{
_val = 0;
if ((_x select 2) > 150000) then {
_val = round((_x select 2) / 16);
} else {
_val = ["483",_crimes] call TON_fnc_index;
_val = ((_crimes select _val) select 1);
if (_val isEqualType "") then {
_val = parseNumber _val;
};
};
[(_x select 0),(_x select 1),"483",_val] remoteExecCall ["life_fnc_wantedAdd",RSERV];
_names = _names + format ["%1<br/>",(_x select 1)];
} forEach _sellers;
hint parseText format [(localize "STR_Cop_DealerMSG")+ "<br/><br/>%1",_names];
(_this select 0) setVariable ["sellers",[],true];
life_action_inUse = false;

View File

@@ -0,0 +1,23 @@
/*
File: fn_radar.sqf
Author: Silly Aussie kid named Jaydon
Description:
Looks like weird but radar?
*/
if !(playerSide isEqualTo west) exitWith {};
private ["_speed","_vehicle"];
_vehicle = cursorObject;
_speed = round speed _vehicle;
if ((_vehicle isKindOf "Car") && (currentWeapon player) isEqualTo "hgun_P07_snds_F") then {
switch (true) do {
case (_speed > 33 && _speed <= 80): {
hint parseText format ["<t color='#ffffff'><t size='2'><t align='center'>" +(localize "STR_Cop_Radar")+ "<br/><t color='#33CC33'><t align='center'><t size='1'>" +(localize "STR_Cop_VehSpeed"),round _speed];
};
case (_speed > 80): {
hint parseText format ["<t color='#ffffff'><t size='2'><t align='center'>" +(localize "STR_Cop_Radar")+ "<br/><t color='#FF0000'><t align='center'><t size='1'>" +(localize "STR_Cop_VehSpeed"),round _speed];
};
};
};

View File

@@ -0,0 +1,83 @@
#include "..\..\script_macros.hpp"
/*
File: fn_repairDoor.sqf
Author: Bryan "Tonic" Boardwine
Description:
Re-locks the door mainly for the federal reserve structures.
*/
private ["_building","_doors","_door","_cP","_cpRate","_ui","_title","_titleText","_locked"];
_building = param [0,objNull,[objNull]];
if (isNull _building) exitWith {};
if (!(_building isKindOf "House_F")) exitWith {hint localize "STR_ISTR_Bolt_NotNear";};
_doors = 1;
_doors = FETCH_CONFIG2(getNumber,"CfgVehicles",(typeOf _building),"NumberOfDoors");
_door = 0;
//Find the nearest door
for "_i" from 1 to _doors do {
_selPos = _building selectionPosition format ["Door_%1_trigger",_i];
_worldSpace = _building modelToWorld _selPos;
if (player distance _worldSpace < 5) exitWith {_door = _i;};
};
if (_door isEqualTo 0) exitWith {hint localize "STR_Cop_NotaDoor"}; //Not near a door to be broken into.
_doorN = _building getVariable [format ["bis_disabled_Door_%1",_door],0];
if (_doorN isEqualTo 1) exitWith {hint localize "STR_House_FedDoor_Locked"};
life_action_inUse = true;
closeDialog 0;
//Setup the progress bar
disableSerialization;
_title = localize "STR_Cop_RepairingDoor";
"progressBar" cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progressBar = _ui displayCtrl 38201;
_titleText = _ui displayCtrl 38202;
_titleText ctrlSetText format ["%2 (1%1)...","%",_title];
_progressBar progressSetPosition 0.01;
_cP = 0.01;
switch (typeOf _building) do {
case "Land_Dome_Big_F": {_cpRate = 0.008;};
case "Land_Medevac_house_V1_F";
case "Land_Research_house_V1_F": {_cpRate = 0.005;};
default {_cpRate = 0.08;}
};
for "_i" from 0 to 1 step 0 do {
if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
[player,"AinvPknlMstpSnonWnonDnon_medic_1",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
player switchMove "AinvPknlMstpSnonWnonDnon_medic_1";
player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
};
sleep 0.26;
if (isNull _ui) then {
"progressBar" cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
};
_cP = _cP + _cpRate;
_progressBar progressSetPosition _cP;
_titleText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_title];
if (_cP >= 1 || !alive player) exitWith {};
if (life_interrupted) exitWith {};
};
//Kill the UI display and check for various states
"progressBar" cutText ["","PLAIN"];
player playActionNow "stop";
if (!alive player) exitWith {life_action_inUse = false;};
if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};
life_action_inUse = false;
_building animateSource [format ["Door_%1_source", _door], 0];
_building setVariable [format ["bis_disabled_Door_%1",_door],1,true]; //Lock the door.
_locked = true;
for "_i" from 1 to _doors do {
if ((_building getVariable [format ["bis_disabled_Door_%1",_i],0]) isEqualTo 0) exitWith {_locked = false};
};
if (_locked) then {
_building setVariable ["locked",true,true];
};

View File

@@ -0,0 +1,94 @@
#include "..\..\script_macros.hpp"
/*
File: fn_restrain.sqf
Author: Bryan "Tonic" Boardwine
Description:
Restrains the client.
*/
private ["_cop","_player","_vehicle"];
_cop = [_this,0,objNull,[objNull]] call BIS_fnc_param;
_player = player;
_vehicle = vehicle player;
if (isNull _cop) exitWith {};
//Monitor excessive restrainment
[] spawn {
private "_time";
for "_i" from 0 to 1 step 0 do {
_time = time;
waitUntil {(time - _time) > (5 * 60)};
if (!(player getVariable ["restrained",false])) exitWith {};
if (!([west,getPos player,30] call life_fnc_nearUnits) && (player getVariable ["restrained",false]) && isNull objectParent player) exitWith {
player setVariable ["restrained",false,true];
player setVariable ["Escorting",false,true];
player setVariable ["transporting",false,true];
detach player;
titleText[localize "STR_Cop_ExcessiveRestrain","PLAIN"];
};
};
};
titleText[format [localize "STR_Cop_Restrained",_cop getVariable ["realname",name _cop]],"PLAIN"];
life_disable_getIn = true;
life_disable_getOut = false;
while {player getVariable "restrained"} do {
if (isNull objectParent player) then {
player playMove "AmovPercMstpSnonWnonDnon_Ease";
};
_state = vehicle player;
waitUntil {animationState player != "AmovPercMstpSnonWnonDnon_Ease" || !(player getVariable "restrained") || vehicle player != _state};
if (!alive player) exitWith {
player setVariable ["restrained",false,true];
player setVariable ["Escorting",false,true];
player setVariable ["transporting",false,true];
detach _player;
};
if (!alive _cop) then {
player setVariable ["Escorting",false,true];
detach player;
};
if (!(isNull objectParent player) && life_disable_getIn) then {
player action["eject",vehicle player];
};
if (!(isNull objectParent player) && !(vehicle player isEqualTo _vehicle)) then {
_vehicle = vehicle player;
};
if (isNull objectParent player && life_disable_getOut) then {
player moveInCargo _vehicle;
};
if (!(isNull objectParent player) && life_disable_getOut && (driver (vehicle player) isEqualTo player)) then {
player action["eject",vehicle player];
player moveInCargo _vehicle;
};
if (!(isNull objectParent player) && life_disable_getOut) then {
_turrets = [[-1]] + allTurrets _vehicle;
{
if (_vehicle turretUnit [_x select 0] isEqualTo player) then {
player action["eject",vehicle player];
sleep 1;
player moveInCargo _vehicle;
};
}forEach _turrets;
};
};
//disableUserInput false;
if (alive player) then {
player switchMove "AmovPercMstpSlowWrflDnon_SaluteIn";
player setVariable ["Escorting",false,true];
player setVariable ["transporting",false,true];
detach player;
};

View File

@@ -0,0 +1,33 @@
#include "..\..\script_macros.hpp"
/*
File: fn_searchClient.sqf
Author: Bryan "Tonic" Boardwine
Description:
Searches the player and he returns information back to the player.
*/
private ["_inv","_val","_var","_robber"];
params [
["_cop",objNull,[objNull]]
];
if (isNull _cop) exitWith {};
_inv = [];
_robber = false;
//Illegal items
{
_var = configName(_x);
_val = ITEM_VALUE(_var);
if (_val > 0) then {
_inv pushBack [_var,_val];
[false,_var,_val] call life_fnc_handleInv;
};
} forEach ("getNumber(_x >> 'illegal') isEqualTo 1" configClasses (missionConfigFile >> "VirtualItems"));
if (!life_use_atm) then {
CASH = 0;
_robber = true;
};
[player,_inv,_robber] remoteExec ["life_fnc_copSearch",_cop];

View File

@@ -0,0 +1,50 @@
#include "..\..\script_macros.hpp"
/*
File: fn_seizeClient.sqf
Author: Daniel "Skalicon" Larusso
Description:
Removes the players weapons client side
*/
private ["_exempt","_uniform","_vest","_headgear"];
_exempt = LIFE_SETTINGS(getArray,"seize_exempt");
_headgear = LIFE_SETTINGS(getArray,"seize_headgear");
_vest = LIFE_SETTINGS(getArray,"seize_vest");
_uniform = LIFE_SETTINGS(getArray,"seize_uniform");
{
if (!(_x in _exempt)) then {
player removeWeapon _x;
};
} forEach weapons player;
{
if (!(_x in _exempt)) then {
player removeItemFromUniform _x;
};
} forEach uniformItems player;
{
if (!(_x in _exempt)) then {
player removeItemFromVest _x;
};
} forEach vestItems player;
{
if (!(_x in _exempt)) then {
player removeItemFromBackpack _x;
};
} forEach backpackItems player;
{
if (!(_x in _exempt)) then {
player removeMagazine _x;
};
} forEach magazines player;
if (uniform player in _uniform) then {removeUniform player;};
if (vest player in _vest) then {removeVest player;};
if (headgear player in _headgear) then {removeHeadgear player;};
[] call SOCK_fnc_updateRequest;
titleText[localize "STR_NOTF_SeizeIllegals","PLAIN"];

View File

@@ -0,0 +1,22 @@
#include "..\..\script_macros.hpp"
/*
File: fn_sirenLights.sqf
Author: Bryan "Tonic" Boardwine
Description:
Lets play a game! Can you guess what it does? I have faith in you, if you can't
then you have failed me and therefor I lose all faith in humanity.. No pressure.
*/
private ["_vehicle"];
_vehicle = param [0,objNull,[objNull]];
if (isNull _vehicle) exitWith {}; //Bad entry!
if (!(typeOf _vehicle in ["C_Offroad_01_F","B_MRAP_01_F","C_SUV_01_F","C_Hatchback_01_sport_F","B_Heli_Light_01_F","B_Heli_Transport_01_F"])) exitWith {}; //Last chance check to prevent something from defying humanity and creating a monster.
_trueorfalse = _vehicle getVariable ["lights",false];
if (_trueorfalse) then {
_vehicle setVariable ["lights",false,true];
} else {
_vehicle setVariable ["lights",true,true];
[_vehicle,0.22] remoteExec ["life_fnc_copLights",RCLIENT];
};

View File

@@ -0,0 +1,14 @@
/*
File: fn_spikeStripEffect.sqf
Author: Bryan "Tonic" Boardwine
Description:
Doesn't work without the server-side effect but shifted part of it clientside
so code can easily be changed. Ultimately it just pops the tires.
*/
private ["_vehicle"];
_vehicle = [_this,0,objNull,[objNull]] call BIS_fnc_param;
if (isNull _vehicle) exitWith {}; //Bad vehicle type
_vehicle setHitPointDamage["HitLFWheel",1];
_vehicle setHitPointDamage["HitRFWheel",1];

View File

@@ -0,0 +1,19 @@
#include "..\..\script_macros.hpp"
/*
File: fn_ticketGive.sqf
Author: Bryan "Tonic" Boardwine
Description:
Gives a ticket to the targeted player.
*/
if (isNil "life_ticket_unit") exitWith {hint localize "STR_Cop_TicketNil"};
if (isNull life_ticket_unit) exitWith {hint localize "STR_Cop_TicketExist"};
private _val = ctrlText 2652;
if (!([_val] call TON_fnc_isnumber)) exitWith {hint localize "STR_Cop_TicketNum"};
if ((parseNumber _val) > 200000) exitWith {hint localize "STR_Cop_TicketOver100"};
[0,"STR_Cop_TicketGive",true,[profileName,[(parseNumber _val)] call life_fnc_numberText,life_ticket_unit getVariable ["realname",name life_ticket_unit]]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
[player,(parseNumber _val)] remoteExec ["life_fnc_ticketPrompt",life_ticket_unit];
closeDialog 0;

View File

@@ -0,0 +1,18 @@
#include "..\..\script_macros.hpp"
/*
File: fn_ticketPaid.sqf
Author: Bryan "Tonic" Boardwine
Description:
Verifies that the ticket was paid.
*/
params [
["_value",5,[0]],
["_unit",objNull,[objNull]],
["_cop",objNull,[objNull]]
];
if (isNull _unit || {!(_unit isEqualTo life_ticket_unit)}) exitWith {}; //NO
if (isNull _cop || {!(_cop isEqualTo player)}) exitWith {}; //Double NO
BANK = BANK + _value;
[1] call SOCK_fnc_updatePartial;

View File

@@ -0,0 +1,47 @@
#include "..\..\script_macros.hpp"
/*
File: fn_ticketPay.sqf
Author: Bryan "Tonic" Boardwine
Description:
Pays the ticket.
*/
if (isNil "life_ticket_val" || isNil "life_ticket_cop") exitWith {};
if (CASH < life_ticket_val) exitWith {
if (BANK < life_ticket_val) exitWith {
hint localize "STR_Cop_Ticket_NotEnough";
[1,"STR_Cop_Ticket_NotEnoughNOTF",true,[profileName]] remoteExecCall ["life_fnc_broadcast",life_ticket_cop];
closeDialog 0;
};
hint format [localize "STR_Cop_Ticket_Paid",[life_ticket_val] call life_fnc_numberText];
BANK = BANK - life_ticket_val;
[1] call SOCK_fnc_updatePartial;
life_ticket_paid = true;
[0,"STR_Cop_Ticket_PaidNOTF",true,[profileName,[life_ticket_val] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",west];
[1,"STR_Cop_Ticket_PaidNOTF_2",true,[profileName]] remoteExecCall ["life_fnc_broadcast",life_ticket_cop];
[life_ticket_val,player,life_ticket_cop] remoteExecCall ["life_fnc_ticketPaid",life_ticket_cop];
if (life_HC_isActive) then {
[getPlayerUID player] remoteExecCall ["HC_fnc_wantedRemove",HC_Life];
} else {
[getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV];
};
closeDialog 0;
};
CASH = CASH - life_ticket_val;
[0] call SOCK_fnc_updatePartial;
life_ticket_paid = true;
if (life_HC_isActive) then {
[getPlayerUID player] remoteExecCall ["HC_fnc_wantedRemove",HC_Life];
} else {
[getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV];
};
[0,"STR_Cop_Ticket_PaidNOTF",true,[profileName,[life_ticket_val] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",west];
closeDialog 0;
[1,"STR_Cop_Ticket_PaidNOTF_2",true,[profileName]] remoteExecCall ["life_fnc_broadcast",life_ticket_cop];
[life_ticket_val,player,life_ticket_cop] remoteExecCall ["life_fnc_ticketPaid",life_ticket_cop];

View File

@@ -0,0 +1,31 @@
#include "..\..\script_macros.hpp"
/*
File: fn_ticketPrompt
Author: Bryan "Tonic" Boardwine
Description:
Prompts the player that he is being ticketed.
*/
private ["_cop","_val"];
if (!isNull (findDisplay 2600)) exitWith {}; //Already at the ticket menu, block for abuse?
_cop = _this select 0;
if (isNull _cop) exitWith {};
_val = _this select 1;
createDialog "life_ticket_pay";
disableSerialization;
waitUntil {!isNull (findDisplay 2600)};
life_ticket_paid = false;
life_ticket_val = _val;
life_ticket_cop = _cop;
CONTROL(2600,2601) ctrlSetStructuredText parseText format ["<t align='center'><t size='.8px'>" +(localize "STR_Cop_Ticket_GUI_Given"),_cop getVariable ["realname",name _cop],_val];
[] spawn {
disableSerialization;
waitUntil {life_ticket_paid || (isNull (findDisplay 2600))};
if (isNull (findDisplay 2600) && !life_ticket_paid) then {
[0,"STR_Cop_Ticket_Refuse",true,[profileName]] remoteExecCall ["life_fnc_broadcast",west];
[1,"STR_Cop_Ticket_Refuse",true,[profileName]] remoteExecCall ["life_fnc_broadcast",life_ticket_cop];
};
};

View File

@@ -0,0 +1,41 @@
#include "..\..\script_macros.hpp"
/*
File: fn_vehInvSearch.sqf
Author: Bryan "Tonic" Boardwine
Description:
Searches the vehicle for illegal items.
*/
private ["_vehicle","_vehicleInfo","_value","_list"];
_vehicle = cursorObject;
_list = ["Air","Ship","LandVehicle"];
if (isNull _vehicle || {!(KINDOF_ARRAY(_vehicle,_list))}) exitWith {};
_vehicleInfo = _vehicle getVariable ["Trunk",[]];
if (count _vehicleInfo isEqualTo 0) exitWith {hint localize "STR_Cop_VehEmpty"};
_value = 0;
_illegalValue = 0;
{
_var = _x select 0;
_val = _x select 1;
_isIllegalItem = M_CONFIG(getNumber,"VirtualItems",_var,"illegal");
if (_isIllegalItem isEqualTo 1 ) then{
_illegalPrice = M_CONFIG(getNumber,"VirtualItems",_var,"sellPrice");
if (!isNull (missionConfigFile >> "VirtualItems" >> _var >> "processedItem")) then {
_illegalItemProcessed = M_CONFIG(getText,"VirtualItems",_var,"processedItem");
_illegalPrice = M_CONFIG(getNumber,"VirtualItems",_illegalItemProcessed,"sellPrice");
};
_illegalValue = _illegalValue + (round(_val * _illegalPrice / 2));
};
} forEach (_vehicleInfo select 0);
_value = _illegalValue;
if (_value > 0) then {
[0,"STR_NOTF_VehContraband",true,[[_value] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
BANK = BANK + _value;
[1] call SOCK_fnc_updatePartial;
_vehicle setVariable ["Trunk",[[],0],true];
} else {
hint localize "STR_Cop_NoIllegalVeh";
};

View File

@@ -0,0 +1,21 @@
#include "..\..\script_macros.hpp"
/*
File: fn_wantedGrab.sqf
Author: ColinM
Description:
Prepare the array to query the crimes.
*/
private ["_display","_tab","_criminal"];
disableSerialization;
_display = findDisplay 2400;
_tab = _display displayCtrl 2402;
_criminal = lbData[2401,(lbCurSel 2401)];
_criminal = call compile format ["%1", _criminal];
if (isNil "_criminal") exitWith {};
if (life_HC_isActive) then {
[player,_criminal] remoteExec ["HC_fnc_wantedCrimes",HC_Life];
} else {
[player,_criminal] remoteExec ["life_fnc_wantedCrimes",RSERV];
};

View File

@@ -0,0 +1,41 @@
#include "..\script_macros.hpp"
/*
File: fn_initCiv.sqf
Author: Bryan "Tonic" Boardwine
Description:
Initializes the civilian.
*/
private _altisArray = ["Land_i_Shop_01_V1_F","Land_i_Shop_01_V2_F","Land_i_Shop_01_V3_F","Land_i_Shop_02_V1_F","Land_i_Shop_02_V2_F","Land_i_Shop_02_V3_F"];
private _tanoaArray = ["Land_House_Small_01_F"];
private _spawnBuildings = [[["Altis", _altisArray], ["Tanoa", _tanoaArray]]] call TON_fnc_terrainSort;
civ_spawn_1 = nearestObjects[getMarkerPos "civ_spawn_1", _spawnBuildings,350];
civ_spawn_2 = nearestObjects[getMarkerPos "civ_spawn_2", _spawnBuildings,350];
civ_spawn_3 = nearestObjects[getMarkerPos "civ_spawn_3", _spawnBuildings,350];
civ_spawn_4 = nearestObjects[getMarkerPos "civ_spawn_4", _spawnBuildings,350];
waitUntil {!(isNull (findDisplay 46))};
if (life_is_alive && !life_is_arrested) then {
/* Spawn at our last position */
player setVehiclePosition [life_civ_position, [], 0, "CAN_COLLIDE"];
} 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};
CASH = 0;
[0] call SOCK_fnc_updatePartial;
};
[] call life_fnc_spawnMenu;
waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.
} else {
if (life_is_arrested) then {
life_is_arrested = false;
[player,true] spawn life_fnc_jail;
};
};
};
life_is_alive = true;
player addRating 9999999;

View File

@@ -0,0 +1,28 @@
#include "..\script_macros.hpp"
/*
File: fn_initCop.sqf
Author: Bryan "Tonic" Boardwine
Description:
Cop Initialization file.
*/
player addRating 9999999;
waitUntil {!(isNull (findDisplay 46))};
if (life_blacklisted) exitWith {
["Blacklisted",false,true] call BIS_fnc_endMission;
sleep 30;
};
if (!(str(player) in ["cop_1","cop_2","cop_3","cop_4"])) then {
if ((FETCH_CONST(life_coplevel) isEqualTo 0) && (FETCH_CONST(life_adminlevel) isEqualTo 0)) then {
["NotWhitelisted",false,true] call BIS_fnc_endMission;
sleep 35;
};
};
player setVariable ["rank",(FETCH_CONST(life_coplevel)),true];
[] call life_fnc_spawnMenu;
waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.

View File

@@ -0,0 +1,19 @@
#include "..\script_macros.hpp"
/*
File: fn_initMedic.sqf
Author: Bryan "Tonic" Boardwine
Description:
Initializes the medic..
*/
player addRating 99999999;
waitUntil {!(isNull (findDisplay 46))};
if ((FETCH_CONST(life_medicLevel)) < 1 && (FETCH_CONST(life_adminlevel) isEqualTo 0)) exitWith {
["Notwhitelisted",false,true] call BIS_fnc_endMission;
sleep 35;
};
[] call life_fnc_spawnMenu;
waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.

View File

@@ -0,0 +1,17 @@
/*
File: fn_setupActions.sqf
Author:
Description:
Master addAction file handler for all client-based actions.
*/
switch (playerSide) do {
case civilian: {
//Drop fishing net
life_actions = [player addAction[localize "STR_pAct_DropFishingNet",life_fnc_dropFishingNet,"",0,false,false,"",'
(surfaceisWater (getPos vehicle player)) && (vehicle player isKindOf "Ship") && life_carryWeight < life_maxWeight && speed (vehicle player) < 2 && speed (vehicle player) > -1 && !life_net_dropped ']];
//Rob person
life_actions = life_actions + [player addAction[localize "STR_pAct_RobPerson",life_fnc_robAction,"",0,false,false,"",'
!isNull cursorObject && player distance cursorObject < 3.5 && isPlayer cursorObject && animationState cursorObject == "Incapacitated" && !(cursorObject getVariable ["robbed",false]) ']];
};
};

View File

@@ -0,0 +1,14 @@
/*
File: fn_setupEVH.sqf
Author: Bryan "Tonic" Boardwine
Description:
Master eventhandler file
*/
player addEventHandler["Killed", {_this call life_fnc_onPlayerKilled}];
player addEventHandler["handleDamage",{_this call life_fnc_handleDamage;}];
player addEventHandler["Respawn", {_this call life_fnc_onPlayerRespawn}];
player addEventHandler["Take",{_this call life_fnc_onTakeItem}]; //Prevent people from taking stuff they shouldn't...
player addEventHandler["Fired",{_this call life_fnc_onFired}];
player addEventHandler["InventoryClosed", {_this call life_fnc_inventoryClosed}];
player addEventHandler["InventoryOpened", {_this call life_fnc_inventoryOpened}];

View File

@@ -0,0 +1,160 @@
/*
File: fn_setupStationService.sqf
Author: NiiRoZz
Edit: BoGuu - Added Tanoa Stations
Description:
Add action fuel action in Station Service.
put function in init file then execute it with:
call getFuelpumps;
getFuelpumps =
{
_pos = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
_Station = nearestobjects [_pos,["Land_fs_feed_F","Land_FuelStation_Feed_F"], 25000];
_br = toString [13, 10];
_tab = toString [9];
_TexteSortie = "_NiiRoZz_Station_Essence = [" + _br;
{
_Array = [getpos _x];
_TexteSortie = _TexteSortie + _tab + (str _Array);
_TexteSortie = if (_forEachIndex < ((count _Station) - 1)) then {_TexteSortie + ", " + _br} else {_TexteSortie + _br};
} forEach _Station;
_TexteSortie = _TexteSortie + "];";
hint "Completed";
copyToClipboard _TexteSortie;
};
*/
private _altisPositions = [
[9205.75,12112.2,-0.0487232],
[11831.6,14155.9,-0.0342016],
[12024.7,15830,-0.0298138],
[12026.6,15830.1,-0.0342979],
[12028.4,15830,-0.0388737],
[9025.78,15729.4,-0.0206528],
[9023.75,15729,-0.0271606],
[9021.82,15728.7,-0.0293427],
[16750.9,12513.1,-0.0525198],
[6798.15,15561.6,-0.0441437],
[6198.83,15081.4,-0.0912418],
[14173.2,16541.8,-0.0946102],
[5023.26,14429.6,-0.0978947],
[5019.68,14436.7,-0.0114822],
[4001.12,12592.1,-0.0966625],
[17417.2,13936.7,-0.10652],
[3757.14,13477.9,-0.0540276],
[3757.54,13485.9,-0.010498],
[16875.2,15469.4,0.037343],
[16871.7,15476.6,0.010293],
[8481.69,18260.7,-0.0266876],
[15297.1,17565.9,-0.283808],
[14221.4,18302.5,-0.0697155],
[15781,17453.2,-0.285281],
[19961.3,11454.6,-0.0349236],
[19965.1,11447.6,-0.0483704],
[5769,20085.7,-0.0156555],
[21230.4,7116.56,-0.0604229],
[20784.8,16665.9,-0.0521202],
[20789.6,16672.3,-0.0213318],
[23379.4,19799,-0.0544052],
[25701.2,21372.6,-0.0774155]
];
private _tanoaPositions = [
[7978.23,7419.24,-0.100807],
[7976.92,7427.11,-0.058516],
[5173.94,8806.35,-0.0822775],
[8318.9,9708.81,-0.0886936],
[8320.71,9712.02,-0.0936089],
[5388.58,4090.7,-0.0951052],
[5379.5,4092.98,-0.0942526],
[10826.8,6489.7,-0.082561],
[8970.37,10332.2,-0.0989342],
[11146.1,5152,-0.0805874],
[11154,5152.43,-0.0809298],
[10935.1,9856.06,-0.129646],
[10940.8,9855.39,-0.122383],
[2462.99,7430.69,-0.0870638],
[2451.51,7434.7,-0.0931244],
[8494.36,12431.9,-0.110229],
[8493.01,12437.9,-0.106827],
[8492.14,12441.6,-0.0828552],
[5594.15,12508.2,-0.0947819],
[11631,2998.85,-0.0782437],
[11642,2990.83,-0.0782394],
[3029.45,11316.1,-0.0828028],
[2137.26,3360.77,-0.0583258],
[2132.29,3360.43,-0.0607367],
[8952.38,13678,-0.0624466],
[8954.36,13678,-0.0624466],
[8956.19,13677.8,-0.0624466],
[14364.7,8743.01,-0.0650101],
[14260.9,11513,-0.114521],
[14264.8,11508.9,-0.108963],
[6886.99,7490.55,0],
[7366.7,7995.42,-0.212462],
[7358.5,7998.4,-0.190624],
[7369.15,8002.09,-0.129763],
[7360.96,8005.08,-0.171917],
[5771.25,4239.42,-0.205085],
[5776.41,4232.31,-0.232585],
[5767.14,4236.94,-0.182347],
[5781.14,4224.93,-0.229755],
[5771.14,4229.01,-0.235736],
[5775.74,4221.55,-0.232986],
[5409.42,9905.04,0.00515461],
[5403.54,9905.04,0.00549698],
[5409.69,9913.75,0.00508261],
[5403.81,9913.74,0.00502348],
[5681.72,10164.6,-0.0340471],
[5685.9,10173,-0.0219851],
[5677.78,10173.8,-0.0185199],
[5683.21,10182,-0.0282073],
[5810.65,10816.9,0.0893035],
[5801.93,10816.8,0.0450912],
[5793.12,10817,0.0373325],
[5810.71,10825.1,0.0521221],
[5801.99,10825,0.039825],
[5793.18,10825.1,0.0337515],
[12613.3,7582.82,-0.264584],
[12618.1,7580.01,-0.330997],
[12617.5,7590.52,-0.225117],
[12622.3,7587.7,-0.245724],
[6600.12,13076.3,-0.249989],
[6592,13079.6,-0.231892],
[6602.45,13082,-0.230906],
[6583.86,13082.9,-0.230913],
[6594.32,13085.3,-0.230906],
[6586.18,13088.6,-0.230906],
[11686.6,2267.25,-0.208622],
[11694.3,2271.39,-0.203085],
[11689.9,2260.98,-0.205484],
[11697.6,2265.13,-0.199961],
[9953.85,13467,-0.23254],
[9960.31,13466.6,-0.23254],
[9954.45,13475.7,-0.23254],
[9960.92,13475.4,-0.23254],
[9954.69,13484.5,-0.23254],
[9961.15,13484.2,-0.23254],
[1873.69,12121.5,-0.248567],
[1874.1,12127.6,-0.203133],
[1864.93,12122,-0.331924],
[1865.37,12128,-0.236609],
[11618.7,13053,-0.255869],
[11627,13050.4,-0.237558],
[11635.3,13047.4,-0.229898],
[11620.6,13058.4,-0.237006],
[11629,13055.8,-0.232919],
[11637.2,13052.8,-0.228891]
];
private _stationPositions = [[["Altis", _altisPositions], ["Tanoa", _tanoaPositions]]] call TON_fnc_terrainSort;
{
private _pump = nearestObjects [_x,["Land_fs_feed_F","Land_FuelStation_01_pump_F","Land_FuelStation_02_pump_F"],5] select 0;
_pump setFuelCargo 0;
_pump addAction [localize "STR_Action_Pump", life_fnc_fuelStatOpen, 1, 3, true, true, "", '_this distance _target < 5 && cursorObject isEqualTo _target'];
false
} count _stationPositions;

View File

@@ -0,0 +1,108 @@
#include "..\script_macros.hpp"
/*
File: fn_survival.sqf
Author: Bryan "Tonic" Boardwine
Description:
All survival? things merged into one thread.
*/
private ["_fnc_food","_fnc_water","_foodTime","_waterTime","_bp","_walkDis","_lastPos","_curPos"];
_fnc_food = {
if (life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";}
else
{
life_hunger = life_hunger - 10;
[] call life_fnc_hudUpdate;
if (life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";};
switch (life_hunger) do {
case 30: {hint localize "STR_NOTF_EatMSG_1";};
case 20: {hint localize "STR_NOTF_EatMSG_2";};
case 10: {
hint localize "STR_NOTF_EatMSG_3";
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
};
};
};
};
_fnc_water = {
if (life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";}
else
{
life_thirst = life_thirst - 10;
[] call life_fnc_hudUpdate;
if (life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";};
switch (life_thirst) do {
case 30: {hint localize "STR_NOTF_DrinkMSG_1";};
case 20: {
hint localize "STR_NOTF_DrinkMSG_2";
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
};
case 10: {
hint localize "STR_NOTF_DrinkMSG_3";
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
};
};
};
};
//Setup the time-based variables.
_foodTime = time;
_waterTime = time;
_walkDis = 0;
_bp = "";
_lastPos = visiblePosition player;
_lastPos = (_lastPos select 0) + (_lastPos select 1);
_lastState = vehicle player;
for "_i" from 0 to 1 step 0 do {
/* Thirst / Hunger adjustment that is time based */
if ((time - _waterTime) > 600) then {[] call _fnc_water; _waterTime = time;};
if ((time - _foodTime) > 850) then {[] call _fnc_food; _foodTime = time;};
/* Adjustment of carrying capacity based on backpack changes */
if (backpack player isEqualTo "") then {
life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight");
_bp = backpack player;
} else {
if (!(backpack player isEqualTo "") && {!(backpack player isEqualTo _bp)}) then {
_bp = backpack player;
life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight") + round(FETCH_CONFIG2(getNumber,"CfgVehicles",_bp,"maximumload") / 4);
};
};
/* Check if the player's state changed? */
if (!(vehicle player isEqualTo _lastState) || {!alive player}) then {
[] call life_fnc_updateViewDistance;
_lastState = vehicle player;
};
/* Check if the weight has changed and the player is carrying to much */
if (life_carryWeight > life_maxWeight && {!isForcedWalk player}) then {
player forceWalk true;
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
hint localize "STR_NOTF_MaxWeight";
} else {
if (isForcedWalk player) then {
player forceWalk false;
};
};
/* Travelling distance to decrease thirst/hunger which is captured every second so the distance is actually greater then 650 */
if (!alive player) then {_walkDis = 0;} else {
_curPos = visiblePosition player;
_curPos = (_curPos select 0) + (_curPos select 1);
if (!(_curPos isEqualTo _lastPos) && {(isNull objectParent player)}) then {
_walkDis = _walkDis + 1;
if (_walkDis isEqualTo 650) then {
_walkDis = 0;
life_thirst = life_thirst - 5;
life_hunger = life_hunger - 5;
[] call life_fnc_hudUpdate;
};
};
_lastPos = visiblePosition player;
_lastPos = (_lastPos select 0) + (_lastPos select 1);
};
uiSleep 1;
};

View File

@@ -0,0 +1,50 @@
/*
File: fn_welcomeNotification.sqf
Author: Bryan "Tonic" Boardwine
Description:
Called upon first spawn selection and welcomes our player.
*/
disableSerialization;
[
"",
0,
0.2,
10,
0,
0,
8
] spawn BIS_fnc_dynamicText;
createDialog "RscDisplayWelcome";
_display = findDisplay 999999;
_text1 = _display displayCtrl 1100;
_buttonSpoiler = _display displayCtrl 2400;
_textSpoiler = _display displayCtrl 1101;
_text2 = _display displayCtrl 1102;
_message = "";
_message = _message + "<t align='center' size='8' shadow='0'><img image='textures\armalife.jpg' /></t><br /><br />";
_message = _message + "Useful links (click on the links to open your browser)<br /><br />";
_message = _message + " <a href='https://github.com/AsYetUntitled/Framework' color='#56BDD6'>AsYetUntitled</a> -- The official repository for the project.<br /><br />";
_message = _message + "TeamSpeak 3 address: ADDRESS HERE <br /><br />";
_message = _message + "Discord invite: <a href='https://discord.gg/sEcQdPn' color='#56BDD6'>ArmA RPG Life</a> <br /><br />";
//Fill only the first text
_text1 ctrlSetStructuredText (parseText _message);
//Resize StructuredText component to display the scrollbar if needed
_positionText1 = ctrlPosition _text1;
_yText1 = _positionText1 select 1;
_hText1 = ctrlTextHeight _text1;
_text1 ctrlSetPosition [_positionText1 select 0, _yText1, _positionText1 select 2, _hText1];
_text1 ctrlCommit 0;
//Hide second text, spoiler text and button
_buttonSpoiler ctrlSetFade 1;
_buttonSpoiler ctrlCommit 0;
_buttonSpoiler ctrlEnable false;
_textSpoiler ctrlSetFade 1;
_textSpoiler ctrlCommit 0;
_text2 ctrlSetFade 1;
_text2 ctrlCommit 0;

View File

@@ -0,0 +1,94 @@
/*%FSM<COMPILE "D:\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, Life Client FSM">*/
/*%FSM<HEAD>*/
/*
item0[] = {"Main_Init",0,250,-40.348839,-141.279068,49.651161,-91.279068,0.000000,"Main Init"};
item1[] = {"true",8,218,-39.994308,-65.712906,50.005692,-15.712896,0.000000,"true"};
item2[] = {"Split",2,4346,-39.994308,10.874098,50.005707,60.874100,0.000000,"Split"};
item3[] = {"Time_to_pay_",4,218,-168.727005,-14.470595,-78.726974,35.529457,0.000000,"Time to pay?"};
link0[] = {0,1};
link1[] = {1,2};
link2[] = {2,3};
link3[] = {3,2};
globals[] = {0.000000,0,0,0,0,640,480,1,26,6316128,1,-456.200378,358.065338,379.837494,-151.171021,1032,673,1};
window[] = {0,-1,-1,-1,-1,893,75,1515,75,1,1050};
*//*%FSM</HEAD>*/
class FSM
{
fsmName = "Life Client FSM";
class States
{
/*%FSM<STATE "Main_Init">*/
class Main_Init
{
name = "Main_Init";
init = /*%FSM<STATEINIT""">*/"private [""_lastcheck"",""_food"",""_water"",""_lastsync""];" \n
"_lastcheck = time;" \n
"_food = time;" \n
"_water = time;" \n
"_lastsync = time;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="Split";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Split">*/
class Split
{
name = "Split";
init = /*%FSM<STATEINIT""">*/"systemChat format [localize ""STR_FSM_Paycheck"",(getNumber(missionConfigFile >> ""Life_Settings"" >> ""paycheck_period""))];"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "Time_to_pay_">*/
class Time_to_pay_
{
priority = 0.000000;
to="Split";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(time - _lastcheck) > ((getNumber(missionConfigFile >> ""Life_Settings"" >> ""paycheck_period"")) * 60)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"if (!alive player) then {" \n
" systemChat localize ""STR_FSM_MissedPay"";" \n
"} else {" \n
" if (player distance (getMarkerPos ""fed_reserve"") < 120 && playerSide isEqualTo west) then {" \n
" systemChat format [localize ""STR_FSM_ReceivedPay"",[(call life_paycheck) + 1500] call life_fnc_numberText];" \n
" life_atmbank = life_atmbank + (call life_paycheck) + 1500;" \n
" } else {" \n
" life_atmbank = life_atmbank + (call life_paycheck);" \n
" systemChat format [localize ""STR_FSM_ReceivedPay"",[(call life_paycheck)] call life_fnc_numberText];" \n
" };" \n
"};" \n
"" \n
"_lastcheck = time;" \n
"" \n
"//Group clean (Local)" \n
"{" \n
" if (local _x && {(units _x isEqualTo [])}) then {" \n
" deleteGroup _x;" \n
" };" \n
"} forEach allGroups;" \n
"" \n
"" \n
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
};
initState="Main_Init";
finalStates[] =
{
};
};
/*%FSM</COMPILE>*/

Some files were not shown because too many files have changed in this diff Show More