Advertisement
Guest User

Untitled

a guest
Jul 15th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.27 KB | None | 0 0
  1. #include "..\script_macros.hpp"
  2. /*
  3.     File: fn_initCiv.sqf
  4.     Author: Bryan "Tonic" Boardwine
  5.  
  6.     Description:
  7.     Initializes the civilian.
  8. */
  9. 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"];
  10. private _tanoaArray = ["Land_House_Small_01_F"];
  11. private _spawnBuildings = [[["Altis", _altisArray], ["Tanoa", _tanoaArray]]] call TON_fnc_terrainSort;
  12.  
  13. waitUntil {!(isNull (findDisplay 46))};
  14. if (isServer) then {
  15. reservedSlotsCiv = [civ_1,civ_2,civ_3,civ_4,civ_5,civ_6,civ_7,civ_8,civ_9,civ_10,civ_11,civ_12,civ_13,civ_14,civ_15,civ_16,civ_17,civ_18,civ_19,civ_20,civ_21,civ_22,civ_23,civ_24,civ_25];
  16.  
  17. ["reserved", "onPlayerConnected", {
  18.     private ["_uid","_player","_UIDList"];
  19.     _UIDListCiv = call compile preProcessFile "scripts/whitelistCiv.txt";
  20.     if (_uid < 1) exitWith {};
  21.  
  22.     _player = objNull;
  23.     while {isNull _player} do {
  24.         sleep 1;
  25.         {
  26.             if (_uid == getPlayerUID _x) then {
  27.                 _player = _x;
  28.             };
  29.         } forEach playableUnits;
  30.     };
  31.  
  32.     if (_player in reservedSlotsCiv) then {
  33.         if (! _uid in _UIDListCiv ) then {
  34.             [["Du bist nicht gelistet fΓΌr diesen Server"], "BIS_fnc_infoText", _player, false] call BIS_fnc_MP;
  35.             sleep 1;
  36.             [["end1",false], "BIS_fnc_endMission", _player, false] call BIS_fnc_MP;
  37.         };
  38.     };
  39. }] call BIS_fnc_addStackedEventHandler;
  40. };
  41.  
  42. if (life_is_alive && !life_is_arrested) then {
  43.     /* Spawn at our last position */
  44.     player setVehiclePosition [life_civ_position, [], 0, "CAN_COLLIDE"];
  45. } else {
  46.     if (!life_is_alive && !life_is_arrested) then {
  47.         if (LIFE_SETTINGS(getNumber,"save_civilian_positionStrict") isEqualTo 1) then {
  48.             _handle = [] spawn life_fnc_civLoadout;
  49.             waitUntil {scriptDone _handle};
  50.             CASH = 0;
  51.             [0] call SOCK_fnc_updatePartial;
  52.         };
  53.         [] call life_fnc_spawnMenu;
  54.         waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
  55.         waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.
  56.     } else {
  57.         if (life_is_arrested) then {
  58.             life_is_arrested = false;
  59.             [player,true] spawn life_fnc_jail;
  60.         };
  61.     };
  62. };
  63. life_is_alive = true;
  64. player addRating 9999999;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement