Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_vehicles","_laptop"];
- fnc_addEventAction = {
- params ["_playerObj"];
- private _playerUID = getPlayerUID _playerObj;
- if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_Unit_Player"}}) then {
- private _playerMoney = _playerObj getVariable ["ExileMoney", 0];
- private _playerRespect = _playerObj getVariable ["ExileScore", 0];
- // Set client's money and respect
- _moneyChange = 1000;
- _repChange = 1000;
- _playerMoney = (_playerMoney + _moneyChange) max 0;
- _playerRespect = _playerRespect + _repChange;
- _playerObj setVariable ["ExileMoney",_playerMoney,true];
- _playerObj setVariable ["ExileScore",_playerRespect,true];
- // Create and send toast to player
- private _msgParams =
- if (_moneyChange > 0) then {
- ["SuccessTitleOnly",[format ["Gained %1 poptabs and %2 repect for hacking the bandits.",abs _moneyChange, _repChange]]] call ExileClient_gui_toaster_addTemplateToast;
- }
- else
- {
- ["ErrorTitleOnly",[format ["Lost %1 poptabs and %2 repect for hacking the bandits.",abs _moneyChange, _repChange]]] call ExileClient_gui_toaster_addTemplateToast;
- };
- // Update money and respect in database
- format["setPlayerMoney:%1:%2", _playerMoney, _playerObj getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
- format["setAccountScore:%1:%2", _playerRespect, _playerUID] call ExileServer_system_database_query_fireAndForget;
- };
- };
- fnc_addHoldAction = {
- params ["_object"];
- /*
- Add a hold action. If the hold actions are not initialized yet, initialize the system first.
- Parameters:
- 0: OBJECT - object action is attached to
- 1: STRING - action title text shown in action menu
- 2: STRING - idle icon shown on screen
- 3: STRING - progress icon shown on screen
- 4: STRING - condition for the action to be shown; special variables passed to the script code are _target (unit to which action is attached to) and _this (caller/executing unit)
- 5: STRING - condition for action to progress; if false is returned action progress is halted; arguments passed into it are: _target, _caller, _id, _arguments
- 6: CODE - code executed on start; arguments passed into it are [target, caller, ID, arguments]
- 0: OBJECT - target (_this select 0) - the object which the action is assigned to
- 1: OBJECT - caller (_this select 1) - the unit that activated the action
- 3: NUMBER - ID (_this select 2) - ID of the activated action (same as ID returned by addAction)
- 4: ARRAY - arguments (_this select 3) - arguments given to the script if you are using the extended syntax
- 7: CODE - code executed on every progress tick; arguments [target, caller, ID, arguments, currentProgress]; max progress is always 24
- 8: CODE - code executed on completion; arguments [target, caller, ID, arguments]
- 9: CODE - code executed on interrupted; arguments [target, caller, ID, arguments]
- 10: ARRAY - arguments passed to the scripts
- 11: NUMBER - action duration; how much time it takes to complete the action
- 12: NUMBER - priority; actions are arranged in descending order according to this value
- 13: BOOL - remove on completion (default: true)
- 14: BOOL - show in unconscious state (default: false)
- Example:
- [_target,_title,_condShow,_condProgress,_codeStart,_codeProgress,_codeCompleted,_codeInterrupted,_arguments,_duration,_priority,_removeCompleted] call bis_fnc_holdActionAdd;
- Returns:
- Action ID, can be used for removal or referencing from other functions.
- */
- [
- _object, // 0 object
- "Download Files", // 1 action title
- "\exile_assets\texture\marker\mission_hardcore_ca.paa", // 2 idle icon
- "\exile_assets\texture\marker\mission_hardcore_ca.paa", // 3 progress icon
- "true", // 4 condition to show
- "true", // 5 condition for action
- {["System", "File download started..."] call BIS_fnc_showSubtitle}, // 6 code executed on start
- {}, // 7 code executed per tick
- {["System", "File downoad complete!"] call BIS_fnc_showSubtitle; call fnc_addEventAction;}, // 8 code executed on completion
- {["System", "Download failed! Please try again."] call BIS_fnc_showSubtitle}, // 9 code executed on interruption
- ["hacker"], // 10 arguments
- 5, // 11 action duration
- 0, // 12 priority
- false, // 13 remove on completion
- false // 14 show unconscious
- ] remoteExec ["bis_fnc_holdActionAdd", -2]; // Multiplayer (remoteExec is the new version of BIS_fnc_MP)
- };
- // Define laptop object spawn
- _laptop = [["Land_Laptop_unfolded_F",[12064.168,2454.260,0.810],332.572,[0,0,1],true]];
- {
- // Create the laptop object
- _objectLaptop = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
- // Set direction
- _objectLaptop setDir (_x select 2);
- // Set position
- _objectLaptop setPos (_x select 1);
- // Disable damage
- _objectLaptop allowDamage false;
- // Add the hold action function but is not working...
- [_objectLaptop] call fnc_addHoldAction;
- // Also tryed this but also not working..
- //_objectLaptop call fnc_addHoldAction;
- // Disabe object simulation
- _objectLaptop enableSimulationGlobal false;
- } foreach _laptop;
- // Define enviroment object for mission etc...
- _vehicles = [
- ["Land_CampingTable_F",[12063.847,2453.986,0],330.493,[0,0,1],true]
- ];
- {
- private ["_objectVehicles"];
- _objectVehicles = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
- if (_x select 4) then {
- _objectVehicles setDir (_x select 2);
- _objectVehicles setPos (_x select 1);
- _objectVehicles allowDamage false;
- _objectVehicles enableSimulationGlobal false;
- } else {
- _objectVehicles setPosATL (_x select 1);
- _objectVehicles setVectorDirAndUp (_x select 3);
- _objectVehicles allowDamage false;
- _objectVehicles enableSimulationGlobal false;
- };
- } foreach _vehicles;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement