Advertisement
Guest User

Untitled

a guest
Jul 14th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private ["_vehicles","_laptop"];
  2.  
  3. fnc_addEventAction = {
  4.     params ["_playerObj"];
  5.     private _playerUID = getPlayerUID _playerObj;
  6.     if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_Unit_Player"}}) then {
  7.         private _playerMoney = _playerObj getVariable ["ExileMoney", 0];
  8.         private _playerRespect = _playerObj getVariable ["ExileScore", 0];
  9.  
  10.         // Set client's money and respect
  11.         _moneyChange = 1000;
  12.         _repChange = 1000;
  13.         _playerMoney = (_playerMoney + _moneyChange) max 0;
  14.         _playerRespect = _playerRespect + _repChange;
  15.         _playerObj setVariable ["ExileMoney",_playerMoney,true];
  16.         _playerObj setVariable ["ExileScore",_playerRespect,true];
  17.  
  18.         // Create and send toast to player
  19.         private _msgParams =
  20.         if (_moneyChange > 0) then {
  21.                 ["SuccessTitleOnly",[format ["Gained %1 poptabs and %2 repect for hacking the bandits.",abs _moneyChange, _repChange]]] call ExileClient_gui_toaster_addTemplateToast;
  22.             }
  23.             else
  24.             {
  25.                 ["ErrorTitleOnly",[format ["Lost %1 poptabs and %2 repect for hacking the bandits.",abs _moneyChange, _repChange]]] call ExileClient_gui_toaster_addTemplateToast;
  26.             };
  27.             // Update money and respect in database
  28.             format["setPlayerMoney:%1:%2", _playerMoney, _playerObj getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
  29.             format["setAccountScore:%1:%2", _playerRespect, _playerUID] call ExileServer_system_database_query_fireAndForget;
  30.     };
  31. };
  32.  
  33. fnc_addHoldAction = {
  34.     params ["_object"];
  35.    
  36.     /*
  37.         Add a hold action. If the hold actions are not initialized yet, initialize the system first.
  38.    
  39.         Parameters:
  40.         0: OBJECT - object action is attached to
  41.         1: STRING - action title text shown in action menu
  42.         2: STRING - idle icon shown on screen
  43.         3: STRING - progress icon shown on screen
  44.         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)
  45.         5: STRING - condition for action to progress; if false is returned action progress is halted; arguments passed into it are: _target, _caller, _id, _arguments
  46.         6: CODE - code executed on start; arguments passed into it are [target, caller, ID, arguments]
  47.             0: OBJECT - target (_this select 0) - the object which the action is assigned to
  48.             1: OBJECT - caller (_this select 1) - the unit that activated the action
  49.             3: NUMBER - ID (_this select 2) - ID of the activated action (same as ID returned by addAction)
  50.             4: ARRAY - arguments (_this select 3) - arguments given to the script if you are using the extended syntax
  51.         7: CODE - code executed on every progress tick; arguments [target, caller, ID, arguments, currentProgress]; max progress is always 24
  52.         8: CODE - code executed on completion; arguments [target, caller, ID, arguments]
  53.         9: CODE - code executed on interrupted; arguments [target, caller, ID, arguments]
  54.         10: ARRAY - arguments passed to the scripts
  55.         11: NUMBER - action duration; how much time it takes to complete the action
  56.         12: NUMBER - priority; actions are arranged in descending order according to this value
  57.         13: BOOL - remove on completion (default: true)
  58.         14: BOOL - show in unconscious state (default: false)
  59.  
  60.         Example:
  61.         [_target,_title,_condShow,_condProgress,_codeStart,_codeProgress,_codeCompleted,_codeInterrupted,_arguments,_duration,_priority,_removeCompleted] call bis_fnc_holdActionAdd;
  62.  
  63.         Returns:
  64.         Action ID, can be used for removal or referencing from other functions.
  65.     */
  66.     [  
  67.         _object,                                                                                            // 0 object
  68.         "Download Files",                                                                                   // 1 action title
  69.         "\exile_assets\texture\marker\mission_hardcore_ca.paa",                                             // 2 idle icon
  70.         "\exile_assets\texture\marker\mission_hardcore_ca.paa",                                             // 3 progress icon
  71.         "true",                                                                                             // 4 condition to show
  72.         "true",                                                                                             // 5 condition for action
  73.         {["System", "File download started..."] call BIS_fnc_showSubtitle},                                 // 6 code executed on start
  74.         {},                                                                                                 // 7 code executed per tick
  75.         {["System", "File downoad complete!"] call BIS_fnc_showSubtitle; call fnc_addEventAction;},         // 8 code executed on completion
  76.         {["System", "Download failed! Please try again."] call BIS_fnc_showSubtitle},                       // 9 code executed on interruption
  77.         ["hacker"],                                                                                         // 10 arguments
  78.         5,                                                                                                  // 11 action duration
  79.         0,                                                                                                  // 12 priority
  80.         false,                                                                                              // 13 remove on completion
  81.         false                                                                                               // 14 show unconscious
  82.     ] remoteExec ["bis_fnc_holdActionAdd", -2];                                                             // Multiplayer (remoteExec is the new version of BIS_fnc_MP)                   
  83. };
  84.  
  85. // Define laptop object spawn
  86. _laptop = [["Land_Laptop_unfolded_F",[12064.168,2454.260,0.810],332.572,[0,0,1],true]];
  87.  
  88. {  
  89.     // Create the laptop object
  90.     _objectLaptop = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
  91.     // Set direction
  92.     _objectLaptop setDir (_x select 2);
  93.     // Set position
  94.     _objectLaptop setPos (_x select 1);
  95.     // Disable damage
  96.     _objectLaptop allowDamage false;
  97.     // Add the hold action function but is not working...
  98.     [_objectLaptop] call fnc_addHoldAction;
  99.     // Also tryed this but also not working..
  100.     //_objectLaptop call fnc_addHoldAction;
  101.     // Disabe object simulation
  102.     _objectLaptop enableSimulationGlobal false;
  103. } foreach _laptop;
  104.  
  105. // Define enviroment object for mission etc...
  106. _vehicles = [
  107.     ["Land_CampingTable_F",[12063.847,2453.986,0],330.493,[0,0,1],true]
  108. ];
  109.  
  110. {
  111.     private ["_objectVehicles"];
  112.     _objectVehicles = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
  113.     if (_x select 4) then {
  114.         _objectVehicles setDir (_x select 2);
  115.         _objectVehicles setPos (_x select 1);
  116.         _objectVehicles allowDamage false;
  117.         _objectVehicles enableSimulationGlobal false;
  118.     } else {
  119.         _objectVehicles setPosATL (_x select 1);
  120.         _objectVehicles setVectorDirAndUp (_x select 3);
  121.         _objectVehicles allowDamage false;
  122.         _objectVehicles enableSimulationGlobal false;
  123.     };
  124. } foreach _vehicles;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement