Jump to content
Sign in to follow this  
igneous01

Simple Bomb defusal with keypad

Recommended Posts

Yes, the way you have it is because of that.

Because of the addAction, only 1 player can activate that action and whoever activates it spawns the IED and the timer. If you made it multiple activation it would just spawn more bombs and more timers.

I would split the scripts up into different things. Use like the example misson and have the bomb timer running for everyone (like my misson does) but make the positions of it random to the players knowledge, but not the makers. So you know the areas the bomb might spawn, but the players will not. See my examples.

You could get it to work out the way you have it, however, you will need to do it differently through addAction or make the addAction global to all players. However, without doing that your script will not work to the other players.

Share this post


Link to post
Share on other sites

Thanks,

Who thought it would be sooo hard to do this through addaction ...LOL

If someone could kindly help me,a demo mission or script change that would be really appreciated.

I need to try and get this to work through addaction on a Laptop that generates a random IED that would work on a dedi server. so anyone could defuse the Device

Bascicaly it will be like a side mission.

Share this post


Link to post
Share on other sites

OK I really need some help here, I have this all working it spawns the suitcase and i get the defuse etc.. the only bit that DOES NOT WORK is the explosion ! ( This is on a Hosted server that it does not work ) - if I test in MP myself it all works ?

I get the defuse and then the title text and the Hint on screen - but for some reason I do not get the explosion ? so the line

_bombexplode = "Bo_GBU12_LGB" createVehicle (position Cheget);

Any ideas why it would not work on a hosted server ?????????????????:confused:

missionIED.sqf

//////////////IED misssion from ////////////////////////////////////////
["remove_action3", []] call CBA_fnc_globalEvent;
if (!isServer) exitWith {};

deletevehicle Cheget;

[nil,nil,rHINT,"We have some Intel on another bomb location, you are to try and defuse the Bomb and stop collateral damage"] call RE;
waituntil { !isNil "BIS_fnc_init" }; 
_random = floor(random 5);
_spawnspot = ["boom1", "boom2", "boom3","boom4","boom5"] select _random; 
Cheget = "Suitcase" createVehicle getmarkerpos _spawnspot;

Cheget setVehicleInit "defuseaction = this addaction [""Defuse"", ""DefuseAction.sqf""]";
processInitCommands;

_marker = createMarker[format["marker%1",Cheget],getmarkerpos _spawnspot ];
_marker setMarkerShape "ICON";
_marker setMarkerType "FLAG";
_marker setMarkerText "Bomb Location";
_marker setMarkerSize [.50, .50];


private ["_code", "_inputcode", "_DEFUSED"];
_code = _this select 0;
_inputcode = _this select 1;
// compare arrays to see if code matches

_DEFUSED = [_code, _inputcode] call BIS_fnc_areEqual;

if (_DEFUSED) then {
titletext ["BOMB DEFUSED", "PLAIN DOWN"];
terminate BombTimerScript;
Cheget removeaction defuseaction;
sleep.5;
HINT " NO BOOM";
deletevehicle Cheget;
};

if (!_DEFUSED) then {
titletext ["BOMB ARMED in 8 SECONDS", "PLAIN DOWN"];
sleep 5;
HINT "BOOM";
_bombexplode = "Bo_GBU12_LGB" createVehicle (position Cheget);
terminate BombTimerScript;
sleep.5;
deletevehicle Cheget;
};

CODEINPUT = [];


Share this post


Link to post
Share on other sites

I found out that some of the objects explode internally. As they explode and it does no damage to the surrounds. The briefcase could be one of them.

Try placing the briefcase with all the actions, and then placing a Baseball and have that as where the bomb spawns in. I did it with my misson and it worked really well.

Share this post


Link to post
Share on other sites

BTW, does anyone have a working link for the codepad script?

Edited by mrjei

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×