Jump to content

Norbak

Member
  • Content Count

    141
  • Joined

  • Last visited

  • Medals

Posts posted by Norbak


  1. Guardogs.sqf from Blitzy script for Arma 2 and Arma 2 OA.

    Why isn't this script working on a dedicated server and doing under a hosted?

    if (Isserver) then {
    //private = ["_dog"];
    
    _leader = _this select 0;
    _leader2 = objNull;
    _leader2 = _this select 3;
    if (!isnull (_leader2 select 0)) then {
    	_leader = _leader2 select 0;
    };
    
    if (isnil "RE") then {[] execVM "\ca\Modules\MP\data\scripts\MPframework.sqf"};
    
    
    
    _side = side _leader;
    _grp = creategroup _side;	
    
    _random = round(random 4) +3;
    
    for "_i" from 1 to _random do {
    _type = round(random 1);
    _breed = "Pastor";
    switch (_type) do {
    	case 0:
    {
    	_breed = "Pastor";
    };
    	case 1:
    {
    	_breed = "Fin";
    };
    };	
    
    		//_dog = _grp createUnit [_breed, getpos _leader,[],20,"none"];
    		_dogname = format ["k9%1",round (random 1000)];
    		call compile format ['"%2" createUnit [getpos _leader, _grp,"%1=this; this setSpeedMode ""full"";this disableAI ""AUTOTARGET"" ; this disableAI ""TARGET"" ; this setCombatMode ""BLUE"";this setbehaviour ""aware""",1]',_dogname,_breed];
    		_dog = call compile format ["%1",_dogname];
    
    		_dog setVariable ["_sound1", "dog_01"];
    		_dog setVariable ["_sound2", "dog_02"];
    
    		[_dog,_leader] spawn {
    		_dog = _this select 0;
    		_leader = _this select 1;
    
    		while {alive _dog} do
    		{	
    				_near_humans = [];
    				_alive_humans = [];
    				_distance = 1000;
    				_neareast = objNull;
    				_near_humans = position _dog nearEntities ["man",100];
    					//{if ((side _x != side _leader) && (side _x != side _dog)) then {_alive_humans = _alive_humans + [_x];_dog knowsabout _x;}}forEach _near_humans;
    					{if ((side _dog)getFriend (side _x) <0.6) then {_alive_humans = _alive_humans + [_x];_dog knowsabout _x;}}forEach _near_humans;
    						if (count _alive_humans >0)  then {
    						_nearest = _alive_humans select 0;
    						_distance = (position _dog) distance (_nearest);
    						if ((_distance > 75) && (_distance < 100)) then {
    						_nic = [objNull, _dog, rSAY, "dog_02"] call RE;
    						_dog dowatch _nearest;
    					};
    						if ((_distance > 50) && (_distance < 75)) then {
    						_nic = [objNull, _dog, rSAY, "dog_01"] call RE;
    						_dog domove position _nearest;
    						_dog setspeedmode "FULL";
    					};
    						if ((_distance > 15) && (_distance < 50)) then {
    						_nic = [objNull, _dog, rSAY, "dog_01"] call RE;
    						_dog domove position _nearest;
    						_dog setspeedmode "FULL";
    					};
    						if ((_distance > 10) && (_distance < 15)) then {
    						_dog domove position _nearest;
    						_dog setspeedmode "FULL";
    					};
    						if (_distance < 10) then {
    						_nic = [objNull, _dog, rSAY, "dog_maul01"] call RE;
    						_dog domove position _nearest;
    						_dog setspeedmode "FULL";
    						[_nearest, _dog] execvm "scripts\dogattack.sqf";
    					};	
    				};
    			sleep 2;
    			//_dog domove position _leader
    			_dog domove [(getpos _leader select 0) - ((random(10)+30)*sin(getdir _leader - 180)), (getpos _leader select 1) - ((random(10)+30)*cos(getdir _leader - 180))];
    			_dog setspeedmode "FULL";
    		};
    	};
    };
    
    };	
    


  2. I can't save the layout inside the backpack. It's only working for main weapons,main magazines and type of backpack but not for the contents of the backpack.

    the script is the Xeno's Savelayout.sqf , a bit modified:

    // by Xeno

    WaitUntil{isDedicated || not isNull player};

    #include "x_setup.sqf"

    _unit = _this select 1;

    _weapons = weapons _unit;

    _magazines = magazines _unit;

    _backpack = unitBackpack _unit;

    _backpackmags = getMagazineCargo _backpack;

    _backpackweps = getWeaponCargo _backpack;

    if (primaryWeapon player == "" || primaryWeapon player == " ") exitWith {"You need a primary weapon to save the layout !!!" call XfGlobalChat};

    _d_custom_layout = [_weapons,_magazines,typeOf _backpack,_backpackmags, _backpackweps];

    d_custom_layout = _d_custom_layout;

    __pSetVar ["d_custom_backpack", if (count __pGetVar(d_player_backpack) > 0) then {

    [__pGetVar(d_player_backpack) select 0, __pGetVar(d_player_backpack) select 1]

    } else {

    []

    }];

    #ifdef __ACE__

    d_custom_ruckbkw = __pGetVar(ACE_weapononback);

    d_custom_ruckmag = __pGetVar(ACE_RuckMagContents);

    d_custom_ruckwep = __pGetVar(ACE_RuckWepContents);

    #endif

    "Weapons and magazines layout saved. You will respawn with this layout." call XfGlobalChat;


  3. I have a problem with this:

    A script "Symp.sqf" and called from an action bar.

    I want when variables "Symp1" and "Symp2" are activated then...

    But it doesn't work. That easy thing and fail!. I'm confused. Anyone know?

    If (Symp1 && Symp2) then {

    SoldierDDBar = SoldierDD addaction [("<t color=""#3838ff"">" + ("Gang Bang!")+"</t>"), "scripts\symp3.sqf", [], 0, false, true, "", ""]

    };


  4. Ok. Changing markers is easy. Createmarkerlocal => createmarker. It's done. Now everybody can see te radiation zone with MP damage.

    Sounds are easy aswell. I used SAY command at every player,so they can hear the sound when it explodes. Another way could be place the SAY3D at the point of explotion but the noise isn't that heavy,especially from 1000 meters away...

    Nuke ,envi and ash is harder.

×