Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enableSaving [false, false];
- if (isServer) then
- {
- FFA_LHOUSEV=[];
- FFA_HOUSES=[];
- FFA_OPENHOUSE = [
- "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",
- "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"];
- FFA_HOUSESCLIENT=[];
- FFA_FUNC_PLAYERCONNECTED = {
- _name=_this select 0;
- _unit=objNull;
- while {isNull _unit} do
- {
- {if ((name _x) == _name) exitwith {_unit= _x}} ForEach playableUnits;
- };
- FFA_HOUSESCLIENT= FFA_HOUSES;
- (owner _unit) publicVariableClient "FFA_HOUSESCLIENT";
- };
- onPlayerConnected "[_name] spawn FFA_FUNC_PLAYERCONNECTED";
- KK_fnc_inString = {
- /*
- Author: Killzone_Kid
- Description:
- Find a string within a string (case insensitive)
- Parameter(s):
- _this select 0: <string> string to be found
- _this select 1: <string> string to search in
- Returns:
- Boolean (true when string is found)
- How to use:
- _found = ["needle", "Needle in Haystack"] call KK_fnc_inString;
- */
- private ["_needle","_haystack","_needleLen","_hay","_found"];
- _needle = _this select 0;
- _haystack = toArray (_this select 1);
- _needleLen = count toArray _needle;
- _hay = +_haystack;
- _hay resize _needleLen;
- _found = false;
- for "_i" from _needleLen to count _haystack do {
- if (toString _hay == _needle) exitWith {_found = true};
- _hay set [_needleLen, _haystack select _i];
- _hay set [0, "x"];
- _hay = _hay - ["x"]
- };
- _found
- };
- if (worldName == "chernarus") then
- {
- FFA_LHOUSEV=nearestObjects [getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"),["house"],15000];
- for "_i" from 0 to (count FFA_LHOUSEV)-1 do
- {
- _housev=FFA_LHOUSEV select _i;
- if ((["Land_HouseV_",str (typeof _housev)] call KK_fnc_inString) || {(["Land_HouseV2_",str (typeof _housev)] call KK_fnc_inString)}) then
- {
- FFA_HOUSES set [count FFA_HOUSES,_housev];
- };
- };
- for "_i" from 0 to (count FFA_HOUSES)-1 do
- {
- _nBuilding =FFA_HOUSES select _i;
- _dirVector = vectorDir _nBuilding;
- _objVector = vectorUp _nBuilding;
- _pos = getposatl _nBuilding;
- _nBuilding hideObject true;
- _type= FFA_OPENHOUSE select (floor random (count FFA_OPENHOUSE));
- _house = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
- _house setVectorDirAndUp [ _dirVector, _objVector];
- };
- };
- };
- if(!isServer || local player)then
- {
- waitUntil{(player==player)};
- waitUntil{alive player};
- waitUntil{local player};
- "FFA_HOUSESCLIENT" addPublicVariableEventHandler {{_x hideObject true} foreach (_this select 1);};
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement