Jump to content
Darihon

[WIP/RELEASE] Bank Robbery V3.

Recommended Posts

On 9/3/2016 at 6:54 AM, Hooty said:

Is the once per restart working correctly? I like the script but players abuse it and dont kill ai. 

punish the ones abusing it, make an example of them, the rest wont abuse it.

As for the once per restart, it should only be able to spawn in once.

Share this post


Link to post
Share on other sites

Ok I've added this _countplayers to my private.

So it looks like 

Spoiler

private ["_loot","_ObjVault","_ObjSign","_countplayers","_aiGroup"];

This 

Spoiler

if (_countplayers > 1) exitWith { cutText [format["Cannot perform this action if a player or zombie is within 5m!"], "PLAIN DOWN"]; };

Under

Spoiler

if(script_in_progress)exitwith{
        systemChat "This script is only useable once (untill restart)!";
};

It has prevented robbing the bank at the same time with another player.

Cant seem to get the only once per restart to work. It only does it for that player that has already robbed the bank. Once they relog they are able to rob again.

Here is what my robbank.sqf looks like

Spoiler

//------------>CREDITS<----------------
//Halvhjearne 
//Spodermayt
//Coco-Nuts
//-------------------------------------


private ["_loot","_ObjVault","_ObjSign","_countplayers"];


// Checks if script is active, thanks Halvhjearne <3
if(isNil "script_in_progress")then{
        script_in_progress = false;
};
 
if(script_in_progress)exitwith{
        systemChat "This script is only useable once (untill restart)!";
};

if (_countplayers > 1) exitWith { cutText [format["Cannot perform this action if a player or zombie is within 5m!"], "PLAIN DOWN"]; };

script_in_progress = true;
// End Checks if Script is active

    [nil,nil,rTitleText,"The Bank is getting robbed!", "PLAIN",6] call RE;
    systemChat "You are robbing the bank! Police and Players have been alerted.";
    sleep 2;
    systemChat "You will got the money in 5 minutes !";
    sleep 2;
    
    //Spawn red sign arrow to show where the vault will appear
    if (true) then
   {
   sleep 10;
   systemChat "The Vault will be at the same location of the red arrow...";
   _ObjSign = createVehicle ["Sign_arrow_down_large_EP1", [7021.36,7637.97,1.350], [], 0, "CAN_COLLIDE"];
   sleep 10;
   deleteVehicle _ObjSign;
   };
    sleep 10;
    cutText [format["4 minutes left..."], "PLAIN DOWN"];
    systemChat "4 minutes left...";
    sleep 60;
    cutText [format["3 minutes left..."], "PLAIN DOWN"];
    systemChat "3 minutes left...";
    sleep 60;
    cutText [format["2 minutes left..."], "PLAIN DOWN"];
    systemChat "2 minutes left...";
    sleep 60;
    cutText [format["1 minute left..."], "PLAIN DOWN"];
    systemChat "1 minute left...";
    sleep 60;
    execVM "rob\ai.sqf";  //Spawn AI
    cutText [format["The Vault is spawning."], "PLAIN DOWN"];
    sleep 5;
    _robComplete = 1;
    
    
if (_robComplete == 1) then {

    _loot=floor(random 6);
        if (_loot == 0) then {
            systemChat "The bank robbery is over!";
            [nil,nil,rTitleText,"The bank robbery is over!", "PLAIN",6] call RE;
            
        if (true) then {
        _ObjVault = objNull;
        _ObjVault = createVehicle ["VaultStorage", [7021.36,7637.97,0.409], [], 0, "CAN_COLLIDE"];
        _ObjVault setPos [7021.36,7637.97,0.409];  
        _ObjVault setDir 70;
        clearWeaponCargoGlobal _ObjVault;
        clearMagazineCargoGlobal _ObjVault;

        _ObjVault addMagazineCargoGlobal ["ItemBriefcase100oz",5];
        _ObjVault setVariable ["ObjectID","1",true];
        _ObjVault setVariable ["permaLoot",true,true];
          
        sleep 1800;
        deleteVehicle _ObjVault;          
          
         };
        };
        if (_loot == 1) then {
            systemChat "The bank robbery is over!!";
            [nil,nil,rTitleText,"The bank robbery is over!!", "PLAIN",6] call RE;
            
            if (true) then {
        _ObjVault = objNull;
        _ObjVault = createVehicle ["VaultStorage", [7021.36,7637.97,0.409], [], 0, "CAN_COLLIDE"];
        _ObjVault setPos [7021.36,7637.97,0.409];  
        _ObjVault setDir 70;
        clearWeaponCargoGlobal _ObjVault;
        clearMagazineCargoGlobal _ObjVault;

        _ObjVault addMagazineCargoGlobal ["ItemBriefcase100oz",6];
        _ObjVault setVariable ["ObjectID","1",true];
        _ObjVault setVariable ["permaLoot",true,true];
          
        sleep 1800;
        deleteVehicle _ObjVault;          
          
         };
        };    
        if (_loot == 2) then {
            systemChat "The bank robbery is over!!";
            [nil,nil,rTitleText,"The bank robbery is over!!", "PLAIN",6] call RE;
            
            if (true) then {
        _ObjVault = objNull;
        _ObjVault = createVehicle ["VaultStorage", [7021.36,7637.97,0.409], [], 0, "CAN_COLLIDE"];
        _ObjVault setPos [7021.36,7637.97,0.409];  
        _ObjVault setDir 70;
        clearWeaponCargoGlobal _ObjVault;
        clearMagazineCargoGlobal _ObjVault;

        _ObjVault addMagazineCargoGlobal ["ItemBriefcase100oz",8];
        _ObjVault setVariable ["ObjectID","1",true];
        _ObjVault setVariable ["permaLoot",true,true];
          
        sleep 1800;
        deleteVehicle _ObjVault;          
          
         };
        };
        if (_loot == 3) then {
            systemChat "The bank robbery is over!!";
            [nil,nil,rTitleText,"The bank robbery is over!!", "PLAIN",6] call RE;
            
            if (true) then {
        _ObjVault = objNull;
        _ObjVault = createVehicle ["VaultStorage", [7021.36,7637.97,0.409], [], 0, "CAN_COLLIDE"];
        _ObjVault setPos [7021.36,7637.97,0.409];  
        _ObjVault setDir 70;
        clearWeaponCargoGlobal _ObjVault;
        clearMagazineCargoGlobal _ObjVault;

        _ObjVault addMagazineCargoGlobal ["ItemBriefcase100oz",7];
        _ObjVault setVariable ["ObjectID","1",true];
        _ObjVault setVariable ["permaLoot",true,true];
          
        sleep 1800;
        deleteVehicle _ObjVault;          
          
         };
        };        
        if (_loot == 4) then {
            systemChat "The bank robbery is over!!";
            [nil,nil,rTitleText,"The bank robbery is over!!", "PLAIN",6] call RE;
            
            if (true) then {
        _ObjVault = objNull;
        _ObjVault = createVehicle ["VaultStorage", [7021.36,7637.97,0.409], [], 0, "CAN_COLLIDE"];
        _ObjVault setPos [7021.36,7637.97,0.409];  
        _ObjVault setDir 70;
        clearWeaponCargoGlobal _ObjVault;
        clearMagazineCargoGlobal _ObjVault;

        _ObjVault addMagazineCargoGlobal ["ItemBriefcase100oz",9];
        _ObjVault setVariable ["ObjectID","1",true];
        _ObjVault setVariable ["permaLoot",true,true];
          
        sleep 1800;
        deleteVehicle _ObjVault;          
          
         };
        };
        if (_loot == 5) then {
            cutText [format["Jack.. Jack.. Pot!!"], "PLAIN DOWN"];
            systemChat "The bank lost everything during the robbery !";
            [nil,nil,rTitleText,"The bank lost everything during the robbery, JACK POT !", "PLAIN",6] call RE;
            
            if (true) then {
        _ObjVault = objNull;
        _ObjVault = createVehicle ["VaultStorage", [7021.36,7637.97,0.409], [], 0, "CAN_COLLIDE"];
        _ObjVault setPos [7021.36,7637.97,0.409];  
        _ObjVault setDir 70;
        clearWeaponCargoGlobal _ObjVault;
        clearMagazineCargoGlobal _ObjVault;

        _ObjVault addMagazineCargoGlobal ["ItemBriefcase100oz",15];
        _ObjVault setVariable ["ObjectID","1",true];
        _ObjVault setVariable ["permaLoot",true,true];
          
        sleep 1800;
        deleteVehicle _ObjVault;          
          
         };
        };
    };
    
    

 

If anyone knows how to fix please share. I'll keep working on this as well and update.

Share this post


Link to post
Share on other sites
5 hours ago, Darihon said:

First of all, I'm sorry for not updating this project. I've been very busy. Secondly, I'd like to know if there is still interest in this script. If there is, I'll redo the whole script and make it much more advanced. Please let me know.

I love the bank robbery script and have it running with 1.0.6.1 any update to it would be nice.

Share this post


Link to post
Share on other sites

Yeah! I like this idea and would love to have it on my server, So when and if you get time to remake it that would be great...Dropbox download is not working anymore :( also could we get a couple screenshots? Thanks

Share this post


Link to post
Share on other sites

Hey @Mig

 

So I removed all the other options of loot and only left

_random2 = floor(random 1);
    // Makes an another random section, which chooses the loot randomly.
        if (_random2 == 1) then {
            cutText [format["Jackpot!!!."], "PLAIN DOWN"];
            player addMagazine _briefcase;
            player addMagazine _briefcase;
            player addMagazine _briefcase;
            player addMagazine _briefcase;
            systemChat "The robber got: 4 briefcases!";
        };

But this isn't giving me briefcase when I rob the bank I still got silver from it, even though I removed anything to do with looting any other currency in the script.

Share this post


Link to post
Share on other sites

@sjd6795

Try this:

replace this bloc:

Spoiler
		if (_random2 == 0) then {
			cutText [format["The vault was emptied recently, no big loot, except some Silver."], "PLAIN DOWN"];
			player addMagazine _silver;
			player addMagazine _silver;
			player addMagazine _silver;
			systemChat "The robber got: 3x Silver";
		};
		if (_random2 == 1) then {
			cutText [format["A small amount of Silver."], "PLAIN DOWN"];
			player addMagazine _silver10oz;
			player addMagazine _silver;
			systemChat "The robber got: 1x Silver10oz & 1x Silver";
		};	
		if (_random2 == 2) then {
			cutText [format["A lot of Silver."], "PLAIN DOWN"];
			player addMagazine _silver10oz;
			player addMagazine _silver10oz;
			player addMagazine _silver10oz;
			player addMagazine _silver10oz;
			player addMagazine _silver10oz;
			systemChat "The robber got: 5x Silver10oz";
		};
		if (_random2 == 3) then {
			cutText [format["Some gold, not much."], "PLAIN DOWN"];
			player addMagazine _gold;
			player addMagazine _gold;
			systemChat "The robber got: 2x Gold";
		};		
		if (_random2 == 4) then {
			cutText [format["A small amount of Gold."], "PLAIN DOWN"];
			player addMagazine _gold10oz;
			player addMagazine _gold10oz;
			player addMagazine _gold;
			systemChat "The robber got: 2x Gold10oz and 1x Gold";
		};
		if (_random2 == 5) then {
			cutText [format["A lot of Gold."], "PLAIN DOWN"];
			player addMagazine _gold10oz;
			player addMagazine _gold10oz;
			player addMagazine _gold10oz;
			player addMagazine _gold10oz;
			player addMagazine _gold10oz;
			systemChat "The robber got: 5x Gold10oz";
		};
		if (_random2 == 6) then {
			cutText [format["A small fortune."], "PLAIN DOWN"];
			player addMagazine _briefcase;
			player addMagazine _briefcase;
			systemChat "The robber got: 2 briefcases!";
		};
		if (_random2 == 7) then {
			cutText [format["Jackpot!!!."], "PLAIN DOWN"];
			player addMagazine _briefcase;
			player addMagazine _briefcase;
			player addMagazine _briefcase;
			player addMagazine _briefcase;
			systemChat "The robber got: 4 briefcases!";
		};		
		// Output if above is not activated.
			} else {
				cutText [format["Bank robbery failed.."], "PLAIN DOWN"];
				systemChat "Bank robbery failed!";
			};

 

with this: 

	cutText [format["Jackpot!!!."], "PLAIN DOWN"];
	player addMagazine _briefcase;
	player addMagazine _briefcase;
	player addMagazine _briefcase;
	player addMagazine _briefcase;
	systemChat "The robber got: 4 briefcases!";

 

Share this post


Link to post
Share on other sites
2 minutes ago, Mig said:

@sjd6795

Try this:

replace this bloc:

 

	cutText [format["Jackpot!!!."], "PLAIN DOWN"];
	player addMagazine _briefcase;
	player addMagazine _briefcase;
	player addMagazine _briefcase;
	player addMagazine _briefcase;
	systemChat "The robber got: 4 briefcases!";

 

Ok I'll give this a try. Also how does the AI_SUV spawn? I set it to 100 so it always spawns but I haven't seen it yet. I noticed it doesn't have any coordinates in the spawn pos. It's all 0,0,0

Share this post


Link to post
Share on other sites

The SUV still wasn't spawning when I used those changes so I did a little work myself on trying to fix it. I've relocated the bank to a custom town so I've changed a lot of the waypoints and also removed the ai_suv.sqf from the config as an enable option and added it timer so it spawns with the AI.sqf and it seems to be working fine, except the gunner doesn't shoot he just looks at me and turns the gun.

I also had to add the vehicle to my dynamic_vehicle.sqf allowed vehicles so it didn't get removed by killing a hacker.

Here is my changed version of the script

ai_suv.sqf

private ["_suvGroup","_randomPos","_suv","_gunner","_driver","_suvWP","_loadout","_aiwep","_aiammo"];
///Spawn a SUV with a driver & gunner near the bank.///

_suvGroup = createGroup EAST;
_randomPos = [[13241, 13962,0.1],[13047, 13974,0.1],[13120, 13932,0.1],[13131, 14120,0.1]] call BIS_fnc_selectRandom;
	
_suv = createVehicle ["ArmoredSUV_PMC_DZE",_randomPos, [], 0, "CAN_COLLIDE"];
_suv setDir round random 360;
_suv setFuel 1;
_suv allowDammage true;

_gunner = _suvGroup createUnit ["BAF_Soldier_L_DDPM",getPos _suv, [], 0, "PRIVATE"];

_gunner assignAsGunner _suv;
_gunner moveInGunner _suv;
_suvGroup selectLeader _gunner;
sleep 15;
_driver = _suvGroup createUnit ["BAF_Soldier_L_DDPM",getPos _suv, [], 0, "PRIVATE"];
_driver assignAsDriver _suv;
_driver moveInDriver _suv;

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_suv];

_suvWP = _suvGroup addWaypoint [[13130, 13958,0],0];
_suvWP setWaypointType "MOVE";
	
_loadout = ["M4A1_AIM_SD_camo","30Rnd_556x45_StanagSD"];
{
    _x enableAI "TARGET";
    _x enableAI "AUTOTARGET";
    _x enableAI "MOVE";
    _x enableAI "ANIM";
    _x enableAI "FSM";
    _x allowDammage true;
    _x setCombatMode "RED";
    _x setBehaviour "COMBAT";
    removeAllWeapons _x
    _aiwep = _loadout select 0;
    _aiammo = _loadout select 1;
    _x addWeapon _aiwep;
    _x addMagazine _aiammo;
    _x addMagazine _aiammo;
    _x setSkill ["aimingAccuracy",1];
    _x setSkill ["aimingShake",1];
    _x setSkill ["aimingSpeed",1];
    _x setSkill ["endurance",1];
    _x setSkill ["spotDistance",0.6];
    _x setSkill ["spotTime",1];
    _x setSkill ["courage",1];
    _x setSkill ["reloadSpeed",1];
    _x setSkill ["commanding",1];
    _x setSkill ["general",1];
} count (units _suvGroup);

robbank.sqf

private ["_gold","_gold10oz","_briefcase","_loot","_robbing"];
_AI = "rob\ai.sqf";
_SUV = "rob\ai_suv.sqf";
// Checks if script is active, thanks Halvhjearne <3
if(isNil "script_in_progress")then{
        script_in_progress = false;
};
 
if(script_in_progress)exitwith{
	systemChat "The bank is empty wait for more loot to be delivered!";
};
script_in_progress = true;
// End Checks if Script is active

	execVM "rob\zone_check.sqf";

cutText [format["You are about to attempt to rob the bank."], "PLAIN DOWN"];
sleep 5;

// Currency // 
_gold = "ItemGoldBar";
_gold10oz = "ItemGoldBar10oz";
_briefcase = "ItemBriefcase100oz";

// Makes sure that the game checks for the 30 percent.
_random = floor(random 11); //0-10
if (_random <= 10) then {
	cutText [format["You are robbing the bank, the police has been warned. 5 minutes left.."], "PLAIN DOWN"];
	sleep 5;
	[nil,nil,rTitleText,"The bank is getting robbed!", "PLAIN",10] call RE;
	sleep 55; 
	cutText [format["4 minutes left.."], "PLAIN DOWN"];
	sleep 20;
	cutText [format["The police has arrived! Protect yourself!"], "PLAIN DOWN"];
	execVM _AI;
	execVM _SUV;
	sleep 40;
	cutText [format["3 minutes left.."], "PLAIN DOWN"];
	sleep 60;
	cutText [format["2 minutes left.."], "PLAIN DOWN"];
	sleep 60;
	cutText [format["1 minute left.."], "PLAIN DOWN"];
	sleep 60;
	player playActionNow "Medic";
	sleep 8;
	[nil,nil,rTitleText,"The bank has been robbed successfully!", "PLAIN",10] call RE;
	_random2 = floor(random 3);
	// Makes an another random section, which chooses the loot randomly.
		if (_random2 == 0) then {
			cutText [format["The vault was emptied recently, no big loot."], "PLAIN DOWN"];
			player addMagazine _gold;
			player addMagazine _gold;
			player addMagazine _gold;
			systemChat "The robber got: 3x Gold";
		};
		if (_random2 == 1) then {
			cutText [format["A lot of Gold."], "PLAIN DOWN"];
			player addMagazine _gold10oz;
			player addMagazine _gold10oz;
			player addMagazine _gold10oz;
			player addMagazine _gold10oz;
			player addMagazine _gold10oz;
			systemChat "The robber got: 5x Gold10oz";
		};
		if (_random2 == 2) then {
			cutText [format["A small fortune."], "PLAIN DOWN"];
			player addMagazine _briefcase;
			player addMagazine _briefcase;
			systemChat "The robber got: 2 briefcases!";
		};
		if (_random2 == 3) then {
			cutText [format["Jackpot!!!."], "PLAIN DOWN"];
			player addMagazine _briefcase;
			player addMagazine _briefcase;
			player addMagazine _briefcase;
			player addMagazine _briefcase;
			systemChat "The robber got: 4 briefcases!";
		};		
		// Output if above is not activated.
			} else {
				cutText [format["Bank robbery failed.."], "PLAIN DOWN"];
				systemChat "Bank robbery failed!";
			};
sleep 600; //10min
script_in_progress = false;

 

 

Share this post


Link to post
Share on other sites

Also the SUV that spawns is the version with no ammo. Instead of ArmoredSUV_PMC_DZE it should be ArmoredSUV_PMC_DZ.

 

I added the vehicle to my allowed vehicles in my dynamic_vehicle.sqf but it keeps getting killed by hacker.

 

Also what is the zone_check suppose to do? I thought it was if player gets so many meters from waypoint the bank robbery fails but that doesn't seem to be happening. I can rob the bank run into the woods and avoid the police and still successfully rob the bank.

How can I make it to where you have to stay inside the building until robbery is successful? 

 

Also the SUV and AI are shooting at each other?

I can't seem to get them on the same side, however both the AI and SUV shoot at me. Both are set to center east

ai_suv.sqf

private ["_suvGroup","_randomPos","_suv","_gunner","_driver","_suvWP","_loadout","_aiwep","_aiammo"];
///Spawn a SUV with a driver & gunner near the bank.///

_suvGroup = createGroup EAST;
_randomPos = [[13241, 13962,0.1],[13047, 13974,0.1],[13120, 13932,0.1]] call BIS_fnc_selectRandom;

_CENTER = createCenter east; //Creates Center.
EAST setFriend [WEST,0]; //Sets West (Survivors) as hostile.
	
_suv = createVehicle ["ArmoredSUV_PMC_DZ",_randomPos, [], 0, "CAN_COLLIDE"];
_suv setDir round random 360;
_suv setFuel 1;
_suv allowDammage true;

_gunner = _suvGroup createUnit ["BAF_Soldier_L_DDPM",getPos _suv, [], 0, "PRIVATE"];

_gunner assignAsGunner _suv;
_gunner moveInGunner _suv;
_suvGroup selectLeader _gunner;
sleep 15;
_driver = _suvGroup createUnit ["BAF_Soldier_L_DDPM",getPos _suv, [], 0, "PRIVATE"];
_driver assignAsDriver _suv;
_driver moveInDriver _suv;

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_suv];

_suvWP = _suvGroup addWaypoint [[13130, 13958,0],0];
_suvWP setWaypointType "MOVE";
	
_loadout = ["M4A1_AIM_SD_camo","30Rnd_556x45_StanagSD"];
{
    _X enableAI "TARGET";
    _X enableAI "AUTOTARGET";
    _X enableAI "MOVE";
    _X enableAI "ANIM";
    _X enableAI "FSM";
    _X allowDammage true;
    _X setCombatMode "RED";
    _X setBehaviour "COMBAT";
    removeAllWeapons [_gunner,_driver]
    _aiwep = _loadout select 0;
    _aiammo = _loadout select 1;
    _X addWeapon _aiwep;
    _X addMagazine _aiammo;
    _X addMagazine _aiammo;
    _X setSkill ["aimingAccuracy",1];
    _X setSkill ["aimingShake",1];
    _X setSkill ["aimingSpeed",1];
    _X setSkill ["endurance",1];
    _X setSkill ["spotDistance",0.6];
    _X setSkill ["spotTime",1];
    _X setSkill ["courage",1];
    _X setSkill ["reloadSpeed",1];
    _X setSkill ["commanding",1];
    _X setSkill ["general",1];
} count (units _suvGroup);

ai.sqf

//////////////////////////////////////////////////////////////
//New Bank AI by Spodermayt, for Darihon's Bank Raid Script.//
/////////////////////////15.10.2014///////////////////////////

private ["_squad1","_squad2","_squad3","_squad4","_squad5","_squad6"];

execVM "rob\bank_config.sqf";
sleep 0.5;

if(_debugBank == 1) then {
	systemChat "[DEBUG] AI successfully executed.";
};

//Init (create center etc)
_CENTER = createCenter east; //Creates Center.
_aiGroup = createGroup east; //Creates a Group.
EAST setFriend [WEST,0]; //Sets West (Survivors) as hostile.

//Spawn 25 AI's.
_squad1 = _aiGroup createUnit ["Policeman",[13185, 13907, 0.1], [], 10, "PRIVATE"];
_squad2 = _aiGroup createUnit ["Policeman",[13109, 13920, 0.1], [], 10, "PRIVATE"];
_squad3 = _aiGroup createUnit ["Policeman",[13107, 13970, 0.1], [], 10, "PRIVATE"];
_squad4 = _aiGroup createUnit ["Policeman",[13130, 14010, 0.1], [], 10, "PRIVATE"];
_squad5 = _aiGroup createUnit ["Policeman",[13190, 13997, 0.1], [], 10, "PRIVATE"];
_squad6 = _aiGroup createUnit ["Policeman",[13249, 13932, 0.1], [], 10, "PRIVATE"];

_target = [13140.3, 13949, 0.0014782]; //Waypoint to Bank.

if(_debugBank == 1) then {
	systemChat "[DEBUG AI] Units Created.";
};

//Add everyone to a "master" group.
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] joinSilent _unitGroup;

//Give everyone weapons.
_squad1 addWeapon "M4A1_Aim";
_squad1 addMagazine "30Rnd_556x45_Stanag";
_squad1 addMagazine "30Rnd_556x45_Stanag";
_squad2 addWeapon "M4A1_Aim";
_squad2 addMagazine "30Rnd_556x45_Stanag";
_squad2 addMagazine "30Rnd_556x45_Stanag";
_squad3 addWeapon "M4A1_Aim";
_squad3 addMagazine "30Rnd_556x45_Stanag";
_squad3 addMagazine "30Rnd_556x45_Stanag";
_squad4 addWeapon "M4A1_Aim";
_squad4 addMagazine "30Rnd_556x45_Stanag";
_squad4 addMagazine "30Rnd_556x45_Stanag";
_squad5 addWeapon "M4A1_Aim";
_squad5 addMagazine "30Rnd_556x45_Stanag";
_squad5 addMagazine "30Rnd_556x45_Stanag";
_squad6 addWeapon "M4A1_Aim";
_squad6 addMagazine "30Rnd_556x45_Stanag";
_squad6 addMagazine "30Rnd_556x45_Stanag";

if(_debugBank == 1) then {
	systemChat "[DEBUG AI] Gave Weapons to AI.";
};

//Set Skills.
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] setSkill ["aimingspeed", 0.5];
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] setSkill ["spotdistance", 0.5];
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] setSkill ["aimingaccuracy", 0.5];
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] setSkill ["aimingshake", 0.5];
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] setSkill ["spottime", 0.2];
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] setSkill ["spotdistance", 0.5];
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] setSkill ["commanding", 0.4];
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] setSkill ["general", 0.5];
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] enableAI "TARGET";
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] enableAI "AUTOTARGET";
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] enableAI "MOVE";
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] enableAI "ANIM";
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] enableAI "FSM";
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] setCombatMode "RED";
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] setBehaviour "COMBAT";
//Move units to bank.
[_squad1,_squad2,_squad3,_squad4,_squad5,_squad6] moveTo _target;
if(_debugBank == 1) then {
	systemChat "[DEBUG AI] Set Units Skills.";
};

I'm also trying to add a getaway vehicle by copying how the ai_suv.sqf works but it doesn't seem to be spawning my helicopter.

here is my getaway.sqf

//get away vehicle

private ["_getawayGroup","_spawnPos","_heli","_driver","_flyWP"];

_CENTER = createCenter west; //Ceates center
_getawayGroup = createGroup WEST;

_spawnPos = [[13122, 13951,0]];

_heli = createVehicle ["AH6J_EP1",_spawnPos, [] ,0 "CAN_COLLIDE"];
_heli setDir round random 360;
_heli setFuel 1;
_heli allowDamage true;

_driver = _getawayGroup createUnit ["Pilot_EP1_DZ".getPos _heli, [], 0, "PRIVATE"];

_driver assignAsDriver _heli;
_driver moveInDriver _heli;
_getawayGroup selectLeader _driver;
sleep 15;

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_heli];

_flyWP = _getawayGroup addWaypoint [[13122, 13951,30,0],0];
_flyWP setWaypointType "MOVE";

{
    _X enableAI "TARGET";
    _X enableAI "AUTOTARGET";
    _X enableAI "MOVE";
    _X enableAI "ANIM";
    _X enableAI "FSM";
    _X allowDammage true;
    _X setCombatMode "GREEN";
    _X setBehaviour "AWARE";
    _X setSkill ["aimingAccuracy",1];
    _X setSkill ["aimingShake",1];
    _X setSkill ["aimingSpeed",1];
    _X setSkill ["endurance",1];
    _X setSkill ["spotDistance",0.6];
    _X setSkill ["spotTime",1];
    _X setSkill ["courage",1];
    _X setSkill ["reloadSpeed",1];
    _X setSkill ["commanding",1];
    _X setSkill ["general",1];
} count (units _getawayGroup);

 

Share this post


Link to post
Share on other sites

@sjd6795

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_suv];

This line will stop the "Killing a hacker" problem, You are adding it after the sleep, you need to add it pretty much after the createVehicle.

Same goes for your helicopter script

Share this post


Link to post
Share on other sites
On 11/4/2018 at 10:55 PM, salival said:

@sjd6795

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_suv];

This line will stop the "Killing a hacker" problem, You are adding it after the sleep, you need to add it pretty much after the createVehicle.

Same goes for your helicopter script

Good to know, thanks I'll adjust that now. I found another solution that seems to work as well. I added DZE_safeVehicle = ["ArmoredSUV_PMC_DZ","AH6X_EP1"]; to my custom variables and that seemed to do the trick.

As for my helicopter not spawning I made some small typos and I got it to spawn but he was wiped out before he could take off by the police lol.

I still can't figure out why the ai.sqf and ai_suv.sqf aren't working together they are both set to east but the ai.sqf attacks the ai_suv.sqf however they both attack me like they should.

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

  • Advertisement
  • Advertisement
  • Supporters
  • Advertisement
  • Discord

×