Jump to content
Sign in to follow this  
ArmAriffic

Map click explosion

Recommended Posts

Hi there,

can be done like this:

ClickBomb.sqf:

[font="Fixedsys"]// ----> Local only
if (!local player) exitWith {};


// ----> Hint
hint "Open your map and mark the target with a single click.";


// ----> (Re)Set variable
MapClicked = false;


// ----> Get the map click
onMapSingleClick "clickPos = _pos; MapClicked = true; onMapSingleClick {};";


// ----> Wait until clicked
waitUntil {MapClicked};


// ----> Create bomb
"Bo_Mk82" createVehicle clickPos;[/font]

Can be called via action for example:

[font="Fixedsys"]player addAction ["Drop bomb","ClickBomb.sqf"];[/font]

Edited by sxp2high

Share this post


Link to post
Share on other sites

No problem... Just keep in mind that my example above is for singleplayer. If you want to use this in a multiplayer mission, we need to make some changes...

Share this post


Link to post
Share on other sites

if (!local player) exitWith {};

Not sure what this is supposed to do? player is local on every client.

if (_this select 1!=player) exitWith {}; will make the script execute only for the caller of the action.

Share this post


Link to post
Share on other sites

How would I put the code directly into the on activation field of a radio trigger, without the scriptcall.

Edited by Two Dogs

Share this post


Link to post
Share on other sites

I understand this script perfectly, My question is is it possible to have it where instead of just one bomb I have 3 bombs exploding in close proximity to each other. what i was trying was to use the map click to get the map pos and then use a random generator to create 3 positions on which bombs would explode with in 20 meters of each other. Any help would be greatly appreciated.

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  

×