Advertisement
Guest User

Chernarus + Takistan

a guest
Mar 31st, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.78 KB | None | 0 0
  1. enableSaving [false, false];
  2.  if (isServer) then
  3. {
  4.     FFA_LHOUSEV=[];
  5.     FFA_HOUSES=[];
  6.     FFA_OPENHOUSE = [
  7.     "Land_House_C_5_EP1","Land_House_C_5_V1_EP1","Land_House_C_5_V2_EP1","Land_House_C_5_V3_EP1","Land_House_C_12_EP1","Land_House_K_1_EP1","Land_House_K_3_EP1","Land_House_K_5_EP1","Land_House_L_8_EP1",
  8.     "Land_House_K_6_EP1","Land_House_K_7_EP1","Land_House_K_8_EP1","Land_House_L_1_EP1","Land_House_L_4_EP1","Land_House_L_6_EP1","Land_House_L_7_EP1","Land_House_L_8_EP1"];
  9.     FFA_HOUSESCLIENT=[];
  10.    
  11.     FFA_FUNC_PLAYERCONNECTED = {
  12.         _name=_this select 0;
  13.         _unit=objNull;
  14.  
  15.         while {isNull _unit} do
  16.         {
  17.             {if ((name _x) == _name) exitwith {_unit= _x}} ForEach playableUnits;
  18.         };
  19.         FFA_HOUSESCLIENT= FFA_HOUSES;
  20.         (owner _unit) publicVariableClient "FFA_HOUSESCLIENT";
  21.     };
  22.    
  23.     onPlayerConnected "[_name] spawn FFA_FUNC_PLAYERCONNECTED";
  24.  
  25.     KK_fnc_inString = {
  26.         /*
  27.         Author: Killzone_Kid
  28.        
  29.         Description:
  30.         Find a string within a string (case insensitive)
  31.        
  32.         Parameter(s):
  33.         _this select 0: <string> string to be found
  34.         _this select 1: <string> string to search in
  35.        
  36.         Returns:
  37.         Boolean (true when string is found)
  38.        
  39.         How to use:
  40.         _found = ["needle", "Needle in Haystack"] call KK_fnc_inString;
  41.         */
  42.  
  43.         private ["_needle","_haystack","_needleLen","_hay","_found"];
  44.         _needle = _this select 0;
  45.         _haystack = toArray (_this select 1);
  46.         _needleLen = count toArray _needle;
  47.         _hay = +_haystack;
  48.         _hay resize _needleLen;
  49.         _found = false;
  50.         for "_i" from _needleLen to count _haystack do {
  51.             if (toString _hay == _needle) exitWith {_found = true};
  52.             _hay set [_needleLen, _haystack select _i];
  53.             _hay set [0, "x"];
  54.             _hay = _hay - ["x"]
  55.         };
  56.         _found
  57.     };
  58.  
  59.     if (worldName == "chernarus") then
  60.     {
  61.         FFA_LHOUSEV=nearestObjects [getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"),["house"],15000];
  62.         for "_i" from 0 to (count FFA_LHOUSEV)-1 do
  63.         {
  64.             _housev=FFA_LHOUSEV select _i;
  65.             if ((["Land_HouseV_",str (typeof _housev)] call KK_fnc_inString) || {(["Land_HouseV2_",str (typeof _housev)] call KK_fnc_inString)}) then
  66.             {
  67.                 FFA_HOUSES set [count FFA_HOUSES,_housev];
  68.             };
  69.         };
  70.         for "_i" from 0 to (count FFA_HOUSES)-1 do
  71.         {
  72.             _nBuilding =FFA_HOUSES select _i;
  73.             _dirVector = vectorDir _nBuilding;
  74.             _objVector = vectorUp _nBuilding;
  75.             _pos = getposatl _nBuilding;
  76.             _nBuilding hideObject true;
  77.             _type= FFA_OPENHOUSE select (floor random (count FFA_OPENHOUSE));
  78.             _house = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
  79.             _house setVectorDirAndUp [ _dirVector, _objVector];
  80.         };
  81.     };
  82. };
  83.  
  84. if(!isServer || local player)then
  85. {
  86.     waitUntil{(player==player)};
  87.     waitUntil{alive player};
  88.     waitUntil{local player};
  89.     "FFA_HOUSESCLIENT" addPublicVariableEventHandler {{_x hideObject true} foreach (_this select 1);};
  90. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement