Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
Владимир12345

[Farm Plantation] - Фермы с Плантациями

Recommended Posts

Цветовое обозначение:
  • Ключевые слова
  • Папки, pbo файлы или Путь к папке
  • Файлы (SQF.SQM.SQS)
Работает на [1.0.5.1]
 
Описание: добавляет на сервер плантации с коноплей и позволяет игрокам собирать ее.

 
 

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

 
 
Установка:
1. Создаем в папке со своей миссией папку scripts . В ней создаем файл hemp.sqf и вставляем туда:
/*
put together for DayZ Epoch
Credits to Shogun338 from Insurrection gaming
modified for separate "gather weed" script
*/
private ["_gearmenu","_playerPos","_nearWeed","_weed","_objectID","_objectUID"];
_playerPos = getPosATL player;
_hempqty = {_x == "ItemKiloHemp"} count magazines player;
_nearWeed = count nearestObjects [_playerPos, ["fiberplant"], 4] > 0;
_weed = nearestObject [player, "fiberplant"];

if !(_nearWeed) exitWith {
    cutText [format["You need to be near the weed plants in order to gather."], "PLAIN DOWN"];
};
if (_hempqty > 2) exitWith { 
    cutText [format["WARNING: %1, You have maximum amount of weed in your inventory! You could get arrested by the police ;)", name player], "PLAIN DOWN"];
};
if (dayz_combat == 1) then { 
    cutText [format["You are in Combat and Cannot Gather the Weed."], "PLAIN DOWN"];
} else {
    disableSerialization;
    _gearmenu = FindDisplay 106;
    _gearmenu CloseDisplay 106;
    player playActionNow "Medic";
    r_interrupt = false;
    sleep 6;
    _objectID = _weed getVariable["ObjectID","0"];
    _objectUID = _weed getVariable["ObjectUID","0"];
    deleteVehicle _weed;
    [_objectID,_objectUID] call server_deleteObj;
    _weed setDamage 1;
    player addMagazine "ItemKiloHemp";
    sleep 2;
    cutText [format["You've Gathered Some Weed! Smoke that shit or sell it at Black market dealer!!"], "PLAIN DOWN"];    
};
2. В той же папке создаем еще один файл с названием smokeshit.sqf, и добавляем туда:
/*
       by: http://infiSTAR.de  Credits to infistar for the actual script
       Edited by FragZ
 
    */
//Add this part after *while {true} do {* to add a smoke effect
  /*  Flare = "SmokeShellGreen" createVehicle position player;
    if (vehicle player != player) then { Flare attachTo [vehicle player,[0,0,0.]];}
       else {Flare attachTo [player,[0,0,0.]];}
*/
   [] spawn {
            hint "You took drugs YOLOLOLO";
            player removeMagazine 'ItemKiloHemp';
            Remove_Drug_effects =
            {
                    {
                            ppEffectDestroy _x;
                    } forEach (_this select 0);
                    ppEffectDestroy nonapsi_ef;
                    ppEffectDestroy wetdist1;
                    ppEffectDestroy ppe;
                    ppEffectDestroy ppe2;
                    ppEffectDestroy ppe3;
                    setaperture 0;
                    "dynamicBlur" ppEffectAdjust [0];
                    "dynamicBlur" ppEffectCommit 16;
                    "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1],  [1, 1, 1, 0.0]];
                    "colorCorrections" ppEffectCommit 0;
            };
            _time = time;
            _effects = [];
            while {true} do
            {
                    nonapsi_ef = ppEffectCreate ["colorCorrections", 1555];
                    _effects = _effects + [nonapsi_ef];
                    nonapsi_ef ppEffectEnable true;
                    nonapsi_ef ppEffectAdjust [1.0, 1.0, -0.03, [0.0, 0.0, 0.0, 0.0], [3.0, 5.0, 9.0, 5.0],[0.4,0.0,0.0, 0.7]];
                    nonapsi_ef ppEffectCommit 1;
                    sleep random(1);
                    wetdist1 = ppEffectCreate ["wetDistortion", 2006];
                    _effects = _effects + [wetdist1];
                    wetdist1 ppEffectAdjust [0, 8, 0.8,8,8, 0.2, 1, 0, 0, 0.08, 0.08, 0, 0, 0, 0.77];
                    wetdist1 ppEffectEnable true;
                    wetdist1 ppEffectCommit 0;
                    ppe = ppEffectCreate ["colorCorrections", 1555];
                    _effects = _effects + [ppe];
                    ppe ppEffectAdjust [1, 1, 0, [1.5,6,2.5,0.5], [5,3.5,5,-0.5], [-3,5,-5,-0.5]];
                    ppe ppEffectCommit 1;
                    ppe ppEffectEnable true;
                    ppe2 = ppEffectCreate ["chromAberration", 1555];
                    _effects = _effects + [ppe2];
                    ppe2 ppEffectAdjust [0.01,0.01,true];
                    ppe2 ppEffectCommit 1;
                    ppe2 ppEffectEnable true;
                    ppe3 = ppEffectCreate ["radialBlur", 1555];
                    _effects = _effects + [ppe3];
                    ppe3 ppEffectEnable true;
                    ppe3 ppEffectAdjust [0.02,0.02,0.15,0.15];
                    ppe3 ppEffectCommit 1;
                    sleep random(1);
                    wetdist1 = ppEffectCreate ["wetDistortion", 2006];
                    _effects = _effects + [wetdist1];
                    wetdist1 ppEffectAdjust [1, 1.16, 0.32, 2.56, 0.8, 0.64, 2.64, 0, 0, 1.08, 0.08, 0, 0, 0, 1.77];
                    wetdist1 ppEffectEnable true;
                    wetdist1 ppEffectCommit 0;
                    sleep random(1);
                    nonapsi_ef = ppEffectCreate ["colorCorrections", 1555];
                    _effects = _effects + [nonapsi_ef];
                    nonapsi_ef ppEffectEnable true;
                    nonapsi_ef ppEffectAdjust [1.0, 1.0, -0.02, [9.5, 1.5, 2.5, 0.2], [2.0, 7.0, 6.0, 2.0],[0.4,0.0,0.0, 0.7]];
                    nonapsi_ef ppEffectCommit 1;
                    sleep random(1);
                    if (_time + 60 < time) exitWith {[_effects] call Remove_Drug_effects;};
            };
    };
3. В папке scripts создаем файл weedfarm.sqf, и добавляем:
/*
        Script by HALV
        Create Weed fields (or other objects) in random locations, amount and "random preset" amount of objects,
        objects are placed "Labyrinth Style" around the middle object
*/
 
_useLocalMarkers = false;
 
if (isServer)then{
        private["_blacklistedAreas"];
        diag_log "[Random_Weed_Farm]: waiting for BIS_fnc_findSafePos";
        waitUntil {(!isNil "BIS_fnc_findSafePos")};
        if(isNil "dayz_MapArea")then{dayz_MapArea = 7000};
        _WorldName = toLower format ["%1", worldName];
 
//settings
        //how many will spawn farms, note that farms can spawn "on top" of eachother (min 1, default 6)
        _farms = 6;
        //min farms (min 1, default 2)
        _farmsmin = 2;
        //how many plants per farm (min 1, default 9)
        _plants = 9;
        //min plants (min 1, default 4)
        _plantsmin = 4;
        //min dist (in meters) from roads to build farms (default 200m)
        _mindist2roads = 200;
        //the object to spawn, default "Fiberplant"
        _fiberplant = "Fiberplant";
        _spawnarea = (dayz_MapArea/2);
        switch(_WorldName)do{
                case "napf":{
                _blacklistedAreas = [
                [[8246.3184,15485.867,0],       500],
                [[15506.952,13229.368,0],       500],
                [[12399.751,5074.5273,0],       500],
                [[10398.626,8279.4619,0],       500],
                [[5149.9814,4864.1191,0],       500],
                [[6633.1538,7254.916,0],        500],
                [[13288.313,19590.338,0],       800]
                ];
                };
                case "chernarus":{
                _blacklistedAreas = [
                [[23999.742,2.4571743,0],       500],
                [[6325.6772,7807.7412,0],       500],
                [[4063.4226,11664.19,0],        500],
                [[11447.472,11364.504,0],       500],
                [[1606.6443,7803.5156,0],       500],
                [[12944.227,12766.889,0],       500],
                [[8122.35,13464.5,0],           500] // <-- no comma for last entry
                ];
                };
                default{
                _blacklistedAreas = [
                        [[0,0,0],       0]
                ];
                };
        };
//function to find x amount of positions around a position (on ground, z axis not included) in a size you define - "labyrinth style"
//[start position, amount of positions to return (ex start pos), distance between positions,include startposition (optional, default true)] call _fnc_positions_array
        _fnc_positions_array = {
                private ["_posi"];
                _pos = _this select 0;
                _amnt = _this select 1;
                _adjust = _this select 2;
                _include = if(count _this > 3)then{_this select 3}else{true};
                _positions = [];
                _buildDir = 0;
                _buildRow = 0;
                _Row = 0;
                _build = 0;
                if(_include)then{_positions set [count _positions,[_pos select 0,_pos select 1,0]];_amnt = _amnt - 1;};
                for "_i" from 0 to (_amnt-1) do {
                        if(_Row > 1)then{_buildRow = _buildRow + 1;_Row = 0;};
                        if(_buildDir > 3)then{_buildDir = 0;};
                        for "_i" from 0 to _buildRow do {
                                switch (_buildDir) do{
                                        case 0:{
                                                _posi = [(_pos select 0),(_pos select 1) + _adjust]; //up
                                                _positions set [count _positions,[_posi select 0,_posi select 1,0]];
                                        };
                                        case 1:{
                                                _posi = [(_pos select 0) + _adjust,(_pos select 1)]; //left
                                                _positions set [count _positions,[_posi select 0,_posi select 1,0]];
                                        };
                                        case 2:{
                                                _posi = [(_pos select 0),(_pos select 1) - _adjust]; //down
                                                _positions set [count _positions,[_posi select 0,_posi select 1,0]];
                                        };
                                        case 3:{
                                                _posi = [(_pos select 0) - _adjust,(_pos select 1)]; //right
                                                _positions set [count _positions,[_posi select 0,_posi select 1,0]];
                                        };
                                };
                                _pos = _posi;
                                _build = _build + 1;
                                if(_build >= _amnt)exitWith{};
                        };
                        _buildDir = _buildDir + 1;
                        _Row = _Row + 1;
                        if(_build >= _amnt)exitWith{};
                };
//              diag_log format["[Random_Weed_Farm]: Debug - _build: '%1' _amnt: '%2' _positions: '%3' %4",_build,_amnt,(count _positions),_positions];
                _positions
        };
 
        _amnt = round(random _farms);
        if(_amnt < _farmsmin)then{_amnt = _farmsmin};
        if(_amnt < 1)then{_amnt = 1};
 
        diag_log format["[Random_Weed_Farm]: Function loaded ... Server Building %1 Weed Farm(s)",_amnt];
 
        _locations = [];
        for "_i" from 0 to (_amnt-1) do {
                private ["_coords"];
                while{true}do{
                        scopeName "posiscope";
                        _coords = [getMarkerPos 'Center',0,_spawnarea,25,0,2000,0] call BIS_fnc_findSafePos;
                        _roadlist = _coords nearRoads _mindist2roads;
                        _IsBlacklisted = false;
                        {if(_coords distance (_x select 0) < (_x select 1))exitWith{_IsBlacklisted = true};}forEach _blacklistedAreas;
                        if((count _roadlist < 1) and !_IsBlacklisted)then{breakOut "posiscope"};
                };
                _locations set [count _locations,[_coords select 0,_coords select 1,0]];
                _amnt = round(random _plants);
                if(_amnt < _plantsmin)then{_amnt = _plantsmin};
                if(_amnt < 1)then{_amnt = 1};
                diag_log format["[Random_Weed_Farm]: Found Location for a farm (%1) %2 with %3 plants",mapGridPosition _coords,_coords,_amnt];
                //aparently sizeOf has problems sometimes, so we iput this manually - else perhaps use [position, amount, sizeOf "object"]
                _plantpositions = [[(_coords select 0),(_coords select 1),0],_amnt,5] call _fnc_positions_array;
                {
                        _plant = createVehicle [_fiberplant, _x, [], 0, "CAN_COLLIDE"];
                        _plant setPos _x;
                        _uID = str(round(random 999999));
                        _plant setVariable ["ObjectID", _uID, true];
                        _plant setVariable ["ObjectUID", _uID, true];
                        _plant setVariable ["lastUpdate",time,true];
                }forEach _plantpositions;
        };
        diag_log "[Random_Weed_Farm]: Weed Farm(s) Done ... Broadcasting locations for clients";
        PV_HALV_Broadcast_weedlocations = _locations;
        publicVariable "PV_HALV_Broadcast_weedlocations";
};
 
//comment out for no markers
if(!isDedicated)then{
        diag_log "[Random_Weed_Farm]: Client awaiting markers ...";
        waitUntil{(!isNil "PV_HALV_Broadcast_weedlocations")};
        //create markers
        _nr = 1;
        for "_i" from 0 to ((count PV_HALV_Broadcast_weedlocations)-1) do {
                _markername = format["WeedFarm_%1",_nr];
                _markertext = format["Weed Farm %1",_nr];
                if(_useLocalMarkers)then{
                        _marker = createMarkerLocal [_markername, (PV_HALV_Broadcast_weedlocations select _i)];
                        _marker setMarkerTypeLocal "Warning";
                        _marker setMarkerTextLocal _markertext;
                        _marker setMarkerColorLocal "ColorGreen";
                }else{
                        if (getMarkerColor _markername == "") then {
                                _marker = createMarker [_markername, (PV_HALV_Broadcast_weedlocations select _i)];
                                _marker setMarkerType "Warning";
                                _marker setMarkerText _markertext;
                                _marker setMarkerColor "ColorGreen";
                        };
                };
                diag_log format["[Random_Weed_Farm]: Client created marker %1 ...",_nr];
                _nr = _nr + 1;
        };
        PV_HALV_Broadcast_weedlocations = nil;
};
4. Идем в init.sqf и находим:
if (isServer) then {
перед этим знаком "};" вставляем:
[] execVM "scripts\weedfarm.sqf";
Готово. Теперь у нас есть плантации,которые спавнятся в рандомных местах по всей карте.
 
 
Вы можете вручную добавить плантации в указанное место.
Пример:
_vehicle_5 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [4050.6616, 7809.3203], [], 0, "CAN_COLLIDE"];
  _vehicle_5 = _this;
  _this setPos [4050.6616, 7809.3203];
};

 
Находим и открываем в миссии ваш файл extra_rc.hpp и вставляем:
class ExtraRc {
    class ItemKnife {
        class farmhemp {
            text = "Harvest the weed";
            script = "execVM 'scripts\hemp.sqf'";
        };
    };
    class ItemKiloHemp {
        class smokeweed {
            text = "Smoke the shit";
            script = "execVM 'scripts\smokeshit.sqf'";
        };
    };
};

 

Edited by DimitriPokki (see edit history)

Share this post


Link to post
Share on other sites



 

Работает на [1.0.5.1]
 
Описание: добавляет на сервер плантации с коноплей и позволяет игрокам собирать ее.
 
Установка:
1. Открываем файл extra_rc.hpp и вставляем:

class ExtraRc {
    class ItemKnife {
        class farmhemp {
            text = "Harvest the weed";
            script = "execVM 'scripts\hemp.sqf'";
        };
    };
    class ItemKiloHemp {
        class smokeweed {
            text = "Smoke the shit";
            script = "execVM 'scripts\smokeshit.sqf'";
        };
    };
};

Если у вас имеются другие классы,по аналогии добавьте эти.
2. Создаем в папке со своей миссией папку scripts . В ней создаем файл hemp.sqf и вставляем туда:

/*
put together for DayZ Epoch
Credits to Shogun338 from Insurrection gaming
modified for separate "gather weed" script
*/
 
private ["_gearmenu","_playerPos","_nearWeed","_weed","_objectID","_objectUID"];
_playerPos = getPosATL player;
_hempqty = {_x == "ItemKiloHemp"} count magazines player;
_nearWeed = count nearestObjects [_playerPos, ["fiberplant"], 4] > 0;
_weed = nearestObject [player, "fiberplant"];
 
if !(_nearWeed) exitWith {
    cutText [format["You need to be near the weed plants in order to gather."], "PLAIN DOWN"];
};
if (_hempqty > 2) exitWith { 
    cutText [format["WARNING: %1, You have maximum amount of weed in your inventory! You could get arrested by the police ;)", name player], "PLAIN DOWN"];
};
if (dayz_combat == 1) then { 
    cutText [format["You are in Combat and Cannot Gather the Weed."], "PLAIN DOWN"];
} else {
    disableSerialization;
    _gearmenu = FindDisplay 106;
    _gearmenu CloseDisplay 106;
    player playActionNow "Medic";
    r_interrupt = false;
    sleep 6;
    _objectID = _weed getVariable["ObjectID","0"];
    _objectUID = _weed getVariable["ObjectUID","0"];
    deleteVehicle _weed;
    [_objectID,_objectUID] call server_deleteObj;
    _weed setDamage 1;
    player addMagazine "ItemKiloHemp";
    sleep 2;
    cutText [format["You've Gathered Some Weed! Smoke that shit or sell it at Black market dealer!!"], "PLAIN DOWN"];    
};

3. В той же папке создаем еще один файл с названием smokeshit.sqf,

И добавляем:

/*
       by: http://infiSTAR.de  Credits to infistar for the actual script
       Edited by FragZ
 
    */
//Add this part after *while {true} do {* to add a smoke effect
  /*  Flare = "SmokeShellGreen" createVehicle position player;
    if (vehicle player != player) then { Flare attachTo [vehicle player,[0,0,0.]];}
       else {Flare attachTo [player,[0,0,0.]];}
*/
   [] spawn {
            hint "You took drugs YOLOLOLO";
            player removeMagazine 'ItemKiloHemp';
            Remove_Drug_effects =
            {
                    {
                            ppEffectDestroy _x;
                    } forEach (_this select 0);
                    ppEffectDestroy nonapsi_ef;
                    ppEffectDestroy wetdist1;
                    ppEffectDestroy ppe;
                    ppEffectDestroy ppe2;
                    ppEffectDestroy ppe3;
                    setaperture 0;
                    "dynamicBlur" ppEffectAdjust [0];
                    "dynamicBlur" ppEffectCommit 16;
                    "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1],  [1, 1, 1, 0.0]];
                    "colorCorrections" ppEffectCommit 0;
            };
            _time = time;
            _effects = [];
            while {true} do
            {
                    nonapsi_ef = ppEffectCreate ["colorCorrections", 1555];
                    _effects = _effects + [nonapsi_ef];
                    nonapsi_ef ppEffectEnable true;
                    nonapsi_ef ppEffectAdjust [1.0, 1.0, -0.03, [0.0, 0.0, 0.0, 0.0], [3.0, 5.0, 9.0, 5.0],[0.4,0.0,0.0, 0.7]];
                    nonapsi_ef ppEffectCommit 1;
                    sleep random(1);
                    wetdist1 = ppEffectCreate ["wetDistortion", 2006];
                    _effects = _effects + [wetdist1];
                    wetdist1 ppEffectAdjust [0, 8, 0.8,8,8, 0.2, 1, 0, 0, 0.08, 0.08, 0, 0, 0, 0.77];
                    wetdist1 ppEffectEnable true;
                    wetdist1 ppEffectCommit 0;
                    ppe = ppEffectCreate ["colorCorrections", 1555];
                    _effects = _effects + [ppe];
                    ppe ppEffectAdjust [1, 1, 0, [1.5,6,2.5,0.5], [5,3.5,5,-0.5], [-3,5,-5,-0.5]];
                    ppe ppEffectCommit 1;
                    ppe ppEffectEnable true;
                    ppe2 = ppEffectCreate ["chromAberration", 1555];
                    _effects = _effects + [ppe2];
                    ppe2 ppEffectAdjust [0.01,0.01,true];
                    ppe2 ppEffectCommit 1;
                    ppe2 ppEffectEnable true;
                    ppe3 = ppEffectCreate ["radialBlur", 1555];
                    _effects = _effects + [ppe3];
                    ppe3 ppEffectEnable true;
                    ppe3 ppEffectAdjust [0.02,0.02,0.15,0.15];
                    ppe3 ppEffectCommit 1;
                    sleep random(1);
                    wetdist1 = ppEffectCreate ["wetDistortion", 2006];
                    _effects = _effects + [wetdist1];
                    wetdist1 ppEffectAdjust [1, 1.16, 0.32, 2.56, 0.8, 0.64, 2.64, 0, 0, 1.08, 0.08, 0, 0, 0, 1.77];
                    wetdist1 ppEffectEnable true;
                    wetdist1 ppEffectCommit 0;
                    sleep random(1);
                    nonapsi_ef = ppEffectCreate ["colorCorrections", 1555];
                    _effects = _effects + [nonapsi_ef];
                    nonapsi_ef ppEffectEnable true;
                    nonapsi_ef ppEffectAdjust [1.0, 1.0, -0.02, [9.5, 1.5, 2.5, 0.2], [2.0, 7.0, 6.0, 2.0],[0.4,0.0,0.0, 0.7]];
                    nonapsi_ef ppEffectCommit 1;
                    sleep random(1);
                    if (_time + 60 < time) exitWith {[_effects] call Remove_Drug_effects;};
            };
    };

4. В папке scripts создаем файл weedfarm.sqf,

И добавляем:

/*
        Script by HALV
        Create Weed fields (or other objects) in random locations, amount and "random preset" amount of objects,
        objects are placed "Labyrinth Style" around the middle object
*/
 
_useLocalMarkers = false;
 
if (isServer)then{
        private["_blacklistedAreas"];
        diag_log "[Random_Weed_Farm]: waiting for BIS_fnc_findSafePos";
        waitUntil {(!isNil "BIS_fnc_findSafePos")};
        if(isNil "dayz_MapArea")then{dayz_MapArea = 7000};
        _WorldName = toLower format ["%1", worldName];
 
//settings
        //how many will spawn farms, note that farms can spawn "on top" of eachother (min 1, default 6)
        _farms = 6;
        //min farms (min 1, default 2)
        _farmsmin = 2;
        //how many plants per farm (min 1, default 9)
        _plants = 9;
        //min plants (min 1, default 4)
        _plantsmin = 4;
        //min dist (in meters) from roads to build farms (default 200m)
        _mindist2roads = 200;
        //the object to spawn, default "Fiberplant"
        _fiberplant = "Fiberplant";
        _spawnarea = (dayz_MapArea/2);
        switch(_WorldName)do{
                case "napf":{
                _blacklistedAreas = [
                [[8246.3184,15485.867,0],       500],
                [[15506.952,13229.368,0],       500],
                [[12399.751,5074.5273,0],       500],
                [[10398.626,8279.4619,0],       500],
                [[5149.9814,4864.1191,0],       500],
                [[6633.1538,7254.916,0],        500],
                [[13288.313,19590.338,0],       800]
                ];
                };
                case "chernarus":{
                _blacklistedAreas = [
                [[23999.742,2.4571743,0],       500],
                [[6325.6772,7807.7412,0],       500],
                [[4063.4226,11664.19,0],        500],
                [[11447.472,11364.504,0],       500],
                [[1606.6443,7803.5156,0],       500],
                [[12944.227,12766.889,0],       500],
                [[8122.35,13464.5,0],           500] // <-- no comma for last entry
                ];
                };
                default{
                _blacklistedAreas = [
                        [[0,0,0],       0]
                ];
                };
        };
//function to find x amount of positions around a position (on ground, z axis not included) in a size you define - "labyrinth style"
//[start position, amount of positions to return (ex start pos), distance between positions,include startposition (optional, default true)] call _fnc_positions_array
        _fnc_positions_array = {
                private ["_posi"];
                _pos = _this select 0;
                _amnt = _this select 1;
                _adjust = _this select 2;
                _include = if(count _this > 3)then{_this select 3}else{true};
                _positions = [];
                _buildDir = 0;
                _buildRow = 0;
                _Row = 0;
                _build = 0;
                if(_include)then{_positions set [count _positions,[_pos select 0,_pos select 1,0]];_amnt = _amnt - 1;};
                for "_i" from 0 to (_amnt-1) do {
                        if(_Row > 1)then{_buildRow = _buildRow + 1;_Row = 0;};
                        if(_buildDir > 3)then{_buildDir = 0;};
                        for "_i" from 0 to _buildRow do {
                                switch (_buildDir) do{
                                        case 0:{
                                                _posi = [(_pos select 0),(_pos select 1) + _adjust]; //up
                                                _positions set [count _positions,[_posi select 0,_posi select 1,0]];
                                        };
                                        case 1:{
                                                _posi = [(_pos select 0) + _adjust,(_pos select 1)]; //left
                                                _positions set [count _positions,[_posi select 0,_posi select 1,0]];
                                        };
                                        case 2:{
                                                _posi = [(_pos select 0),(_pos select 1) - _adjust]; //down
                                                _positions set [count _positions,[_posi select 0,_posi select 1,0]];
                                        };
                                        case 3:{
                                                _posi = [(_pos select 0) - _adjust,(_pos select 1)]; //right
                                                _positions set [count _positions,[_posi select 0,_posi select 1,0]];
                                        };
                                };
                                _pos = _posi;
                                _build = _build + 1;
                                if(_build >= _amnt)exitWith{};
                        };
                        _buildDir = _buildDir + 1;
                        _Row = _Row + 1;
                        if(_build >= _amnt)exitWith{};
                };
//              diag_log format["[Random_Weed_Farm]: Debug - _build: '%1' _amnt: '%2' _positions: '%3' %4",_build,_amnt,(count _positions),_positions];
                _positions
        };
 
        _amnt = round(random _farms);
        if(_amnt < _farmsmin)then{_amnt = _farmsmin};
        if(_amnt < 1)then{_amnt = 1};
 
        diag_log format["[Random_Weed_Farm]: Function loaded ... Server Building %1 Weed Farm(s)",_amnt];
 
        _locations = [];
        for "_i" from 0 to (_amnt-1) do {
                private ["_coords"];
                while{true}do{
                        scopeName "posiscope";
                        _coords = [getMarkerPos 'Center',0,_spawnarea,25,0,2000,0] call BIS_fnc_findSafePos;
                        _roadlist = _coords nearRoads _mindist2roads;
                        _IsBlacklisted = false;
                        {if(_coords distance (_x select 0) < (_x select 1))exitWith{_IsBlacklisted = true};}forEach _blacklistedAreas;
                        if((count _roadlist < 1) and !_IsBlacklisted)then{breakOut "posiscope"};
                };
                _locations set [count _locations,[_coords select 0,_coords select 1,0]];
                _amnt = round(random _plants);
                if(_amnt < _plantsmin)then{_amnt = _plantsmin};
                if(_amnt < 1)then{_amnt = 1};
                diag_log format["[Random_Weed_Farm]: Found Location for a farm (%1) %2 with %3 plants",mapGridPosition _coords,_coords,_amnt];
                //aparently sizeOf has problems sometimes, so we iput this manually - else perhaps use [position, amount, sizeOf "object"]
                _plantpositions = [[(_coords select 0),(_coords select 1),0],_amnt,5] call _fnc_positions_array;
                {
                        _plant = createVehicle [_fiberplant, _x, [], 0, "CAN_COLLIDE"];
                        _plant setPos _x;
                        _uID = str(round(random 999999));
                        _plant setVariable ["ObjectID", _uID, true];
                        _plant setVariable ["ObjectUID", _uID, true];
                        _plant setVariable ["lastUpdate",time,true];
                }forEach _plantpositions;
        };
        diag_log "[Random_Weed_Farm]: Weed Farm(s) Done ... Broadcasting locations for clients";
        PV_HALV_Broadcast_weedlocations = _locations;
        publicVariable "PV_HALV_Broadcast_weedlocations";
};
 
//comment out for no markers
if(!isDedicated)then{
        diag_log "[Random_Weed_Farm]: Client awaiting markers ...";
        waitUntil{(!isNil "PV_HALV_Broadcast_weedlocations")};
        //create markers
        _nr = 1;
        for "_i" from 0 to ((count PV_HALV_Broadcast_weedlocations)-1) do {
                _markername = format["WeedFarm_%1",_nr];
                _markertext = format["Weed Farm %1",_nr];
                if(_useLocalMarkers)then{
                        _marker = createMarkerLocal [_markername, (PV_HALV_Broadcast_weedlocations select _i)];
                        _marker setMarkerTypeLocal "Warning";
                        _marker setMarkerTextLocal _markertext;
                        _marker setMarkerColorLocal "ColorGreen";
                }else{
                        if (getMarkerColor _markername == "") then {
                                _marker = createMarker [_markername, (PV_HALV_Broadcast_weedlocations select _i)];
                                _marker setMarkerType "Warning";
                                _marker setMarkerText _markertext;
                                _marker setMarkerColor "ColorGreen";
                        };
                };
                diag_log format["[Random_Weed_Farm]: Client created marker %1 ...",_nr];
                _nr = _nr + 1;
        };
        PV_HALV_Broadcast_weedlocations = nil;
};

5. Идем в init.sqf и находим:
if (isServer) then {
перед "};" вставляем:
[] execVM "scripts\weedfarm.sqf";
Готово. Теперь у нас есть плантации,которые спавнятся в рандомных местах по всей карте.
 
Вы можете вручную добавить плантации в указанное место. Пример:

_vehicle_5 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [4050.6616, 7809.3203], [], 0, "CAN_COLLIDE"];
  _vehicle_5 = _this;
  _this setPos [4050.6616, 7809.3203];
};

Оформи нормально, щас админы придут говорить наверное будут

Share this post


Link to post
Share on other sites

Да что не так то оформил

Не, ну ты или нифига не понимаешь или... да хз :D

Короче цветов нельзя столько много использовать. Исправляй. И гайд напиши нормально. Неудобно читать. Вон у меня хотя бы посмотри как оформлено. 2 дня даю что бы исправил.

Share this post


Link to post
Share on other sites

 

Способ 2й Для опытных Скрытый текст Находим и открываем в миссии ваш файл extra_rc.hpp и вставляем: class ExtraRc { class ItemKnife { class farmhemp { text = "Harvest the weed"; script = "execVM 'scripts\hemp.sqf'"; }; }; class ItemKiloHemp { class smokeweed { text = "Smoke the shit"; script = "execVM 'scripts\smokeshit.sqf'"; }; }; };

Это как понять для опытных, ты хочешь сказать для неопытных не надо делать этот пункт? Или ты просто забыл рассказать что надо еще скрипт ПКМ от Мака добавить?

Share this post


Link to post
Share on other sites

Мне вот интересно с какого источника он гайды тырит.

Share this post


Link to post
Share on other sites

Трава появилась но не собирается( может нужно подождать когда он поспеет? 

Пример с ютьюба http://www.youtube.com/watch?v=TFWi3chu1Xg

так все правильно, и выше писали о скрипте Maca для extra_rc.hpp, без него само собой работать не будет. тут даже указаний нету на этот скрипт. Если у кого установлен daploy anithing 2.8.0 скрипт маки ставить на недо, просто прописать для ItemKnife ссылку на  hemp.sqf  

а для ItemKiloHemp ссылку на smokeshit.sqf,

 

Мне вот интересно с какого источника он гайды тырит.

Уважаемый Таурен! Может всетаки стоит важные комментарии с целеуказаниями к недо-скриптам выносить в шапку, просто уже миллион раз сталкивался с тем что приходится перечитать 100500 страниц форума пока до сути докапаешься.

 

class ItemKnife {
        class farmhemp {
            text = "Harvest the weed";
            script = "execVM 'scripts\hemp.sqf'";
        };
    };
	class ItemKiloHemp {
        class smokeweed {
            text = "Smoke the shit";
            script = "execVM 'scripts\smokeshit.sqf'";
        };
    };

Это что бы работала эта байда, вписать в extra_rc.hpp, если у кого daploy_anithing пишите я выложу как добавить в него правый клик

 

вот на форуме нашел тему с макой :) http://s-platoon.ru/index.php?/topic/1794-pkm-optcii-u-predmeta-maca-rc/

Share this post


Link to post
Share on other sites

 

Может всетаки стоит важные комментарии с целеуказаниями к недо-скриптам выносить в шапку

 

Видел давно ещё такую фичу. Но для нашей версии форума она не работает, т.к. плагин старый. А платить за рабочий 100% у меня возможности сейчас нет.

Share this post


Link to post
Share on other sites

Видел давно ещё такую фичу. Но для нашей версии форума она не работает, т.к. плагин старый. А платить за рабочий 100% у меня возможности сейчас нет.

жалко однако(

Share this post


Link to post
Share on other sites

Парень хотел, что то путнее сделать, поделится чем то, может быть выделится, а его запинали сразу, вот так и губятся таланты в России!!!

Share this post


Link to post
Share on other sites

Парень хотел, что то путнее сделать, поделится чем то, может быть выделится, а его запинали сразу, вот так и губятся таланты в России!!!

Русские изобретатели уникальны, они могут сотворить чудо (которое будет работать до скончания века), но хрен знать из чего он это чудо по пьяни собрал :laugh:

Share this post


Link to post
Share on other sites

Можно было бы еще добавить разъяснение в теме для статических плантаций

 

Создаем файл в папке (название папки придумываем сами, или в готовую куда удобнее) допустим hemp.sqf и в него ложим

 

_vehicle_5 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [4050.6616, 7809.3203], [], 0, "CAN_COLLIDE"];
  _vehicle_5 = _this;
  _this setPos [4050.6616, 7809.3203];
};
 

а потом в init.sqf в самом низу подгружаем его

 

 

[] execVM "Ваша_Папка\hemp.sqf";
 

 

Edited by thorus (see edit history)

Share this post


Link to post
Share on other sites

Мне скрипт очень нравиться и всё такое ,ставлю + , но у меня вопрос ,я хочу изменить куренье ,а именно эффект , я хочу что бы он падал от дури , на землю и не мог встать , а не только смотрел интересные картинки , что туда прописать ? ото я хз)

Edited by Жека (see edit history)

Share this post


Link to post
Share on other sites

Мне скрипт очень нравиться и всё такое ,ставлю + , но у меня вопрос ,я хочу изменить куренье ,а именно эффект , я хочу что бы он падал от дури , на землю и не мог встать , а не только смотрел интересные картинки , что туда прописать ? ото я хз)

_time = time;
            _effects = [];
			player playMoveNow "ActsPercMstpSnonWpstDnon_sceneBardak01";
            while {true} do

Share this post


Link to post
Share on other sites

 

_time = time;
            _effects = [];
			player playMoveNow "ActsPercMstpSnonWpstDnon_sceneBardak01";
            while {true} do

Спасиб , но можешь мне помочь ещё разок , мне нужно узнать координаты на карте чтоб поставить туда плантацию , а как это сделать я хз ) я спамил технику через админку , чтоб писало координаты техники , но эти координаты не верны и я хз как задать координаты для плантаций ) думаю ты сможешь мне помочь )

Share this post


Link to post
Share on other sites

Спасиб , но можешь мне помочь ещё разок , мне нужно узнать координаты на карте чтоб поставить туда плантацию , а как это сделать я хз ) я спамил технику через админку , чтоб писало координаты техники , но эти координаты не верны и я хз как задать координаты для плантаций ) думаю ты сможешь мне помочь )

админ-дэбаг в помощь

Share this post


Link to post
Share on other sites

Блин! ну элементарная простановка!!!, а не фига не работает!!! Подскажите плиз... может кто сталкивался с таким:

1. Маркеров на карте не появляется!

2. На ноже ПКМ работает!, и при нажатии из выпадающего меню пишет что травка рядом не обнаружена!

 

А сам файл extra_rc.hpp должен быть кастомный?, или можно создать пустой и вставить class?

class ExtraRc {
    class ItemKnife {
        class farmhemp {
            text = "Harvest the weed";
            script = "execVM 'scripts\hemp.sqf'";
        };
    };
    class ItemKiloHemp {
        class smokeweed {
            text = "Smoke the shit";
            script = "execVM 'scripts\smokeshit.sqf'";
        };
    };
};
Edited by hacksan (see edit history)

Share this post


Link to post
Share on other sites

А маркеры на карте должны разве быть? Просто у меня в RPT пишет что поля заспавнены типа но я на карте не вижу меток. Их что искать нужно? как они хоть выглядят?

Share this post


Link to post
Share on other sites

А маркеры на карте должны разве быть? Просто у меня в RPT пишет что поля заспавнены типа но я на карте не вижу меток. Их что искать нужно? как они хоть выглядят?

Да вроде ничего необычного) маркеры как маркеры

Share this post


Link to post
Share on other sites

Да вроде ничего необычного) маркеры как маркеры

Немного не так ты понял мой вопрос. Я спросил метки ДОЛЖНЫ ЛИ быть этих полей. Либо поля нужно самому найти?

Share this post


Link to post
Share on other sites

[success=Пофиксил вид темы, оформление, добавил скриншот][/success]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Troy1
      Всем привет. Подскжите ну или помогите пожалуйста решить вопрос.
      Вопрос звучит так. На сервере есть трейдер зоны и базы игроков. 
      Если в течение определённого времени, на пример 1 - 2 часа с машиной не кто не взаимодействует и машина не находится в зоне трейдера или на теретории базы, то машина отлетает в гараж или на штраф стоянку.
      На сервере используется TraderPlus.
       
      Есть такие решения у кого?
      За ранние благодарю.
    • By Troy1
      Всем привет. Подскжите ну или помогите пожалуйста решить вопрос.
      Вопрос звучит так. Нужно сделать так, что бы на всей карте был запрет на строительство. 
      Если нужно построить например базу с палатками, то нужно установить верстак или флаг, который установит зону для строительства с радиусом примерно 20-25 метров от центра и желательно что бы зона была квадратной.
      Есть такие решения у кого?
      За ранние благодарю.
    • By BR0wi
      Подскажите где найти людей, которые делаю моды на заказ. К кому вообще обращаться? Или что бы реализовать свои идеи нужно самому "год" сидеть и изучать все механики модинга?
    • By CubeIn
      Приветствую господа, хочу создать новый проект, уникальный, но для этого нужен маппер.
      Я оставлю здесь свой дискрод, напишите в лс, кто готов взяться за крупный проект.
      4me#4542
    • By 6agu
      Поставил
      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.
  • Our picks

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.