Jump to content

Recommended Posts

How could I drop a bomb where my cursor is at (coordinates), with or without people being nearby?

Share this post


Link to post
Share on other sites

You can use the command onMapSingleClick command to use your cursor position example : 

openMap true; onMapSingleClick "'HandGrenade' createVehicle _pos; openMap false; true"; 

this should open your map then wait for you to click then closes the map and spawns a grenade on the position.

Share this post


Link to post
Share on other sites
6 hours ago, ACoolDuck said:

You can use the command onMapSingleClick command to use your cursor position example : 


openMap true; onMapSingleClick "'HandGrenade' createVehicle _pos; openMap false; true"; 

this should open your map then wait for you to click then closes the map and spawns a grenade on the position.

I have a feeling it is not possible but doing the same without using the map.

Share this post


Link to post
Share on other sites

use cursortarget for position if you want to use where you are looking at. So 

'HandGrenade' createVehicle cursorTarget;
Edited by ACoolDuck
adding code example

Share this post


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

use cursortarget for position if you want to use where you are looking at. So 


'HandGrenade' createVehicle cursorTarget;


Would you please stop posting nonsense? Guaranteed you are new, so please make sure you test your suggestions before you give them. Thank you.

Share this post


Link to post
Share on other sites
27 minutes ago, killzone_kid said:


Would you please stop posting nonsense? Guaranteed you are new, so please make sure you test your suggestions before you give them. Thank you.

Yes sorry about that. Tested. cursorTarget sometimes allows me to create an object there and sometimes doesn't. Probably not a good idea to use this method although at the moment it's the only one i can think of.

 

Although the cursortarget one is not reliable this is the fixed version of the map method:

openMap true; onMapSingleClick "'GrenadeHand' createVehicle _pos; openMap false; true"; 

 

Edited by ACoolDuck
adding fix for map

Share this post


Link to post
Share on other sites
Just now, killzone_kid said:


No, you haven't tested anything. You know how I know that? Because there is no vehicle class HandGrenade therefore you cannot create vehicle with this name. So once again I ask you nicely, please stop posting nonsense. You are not helping anyone by posting broken code, you only make it difficult for anyone to find what they are looking for. 

I corrected it to GrenadeHand....

Share this post


Link to post
Share on other sites
34 minutes ago, ACoolDuck said:

Yes sorry about that. Tested. cursorTarget sometimes allows me to create an object there and sometimes doesn't.

Because using cursorTarget is a bad approach since there's no object under your cursor most of the time. The correct command is screenToWorld [0.5,0.5].

Sorry, I know you're trying to help but k_k is kinda right about this.

Share this post


Link to post
Share on other sites
Just now, theend3r said:

Because using cursorTarget is a bad approach since there's no object under your cursor most of the time. The correct command is screenToWorld [0.5,0.5].

Nice job!

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

×