Forum Jump :

Author Message


Posts: 23
Rank:


Level: Hidden

Country: iq
Location:
Occupation:
Age: 22
In-game name: Mohammed

 
#1 Posted at 2012-08-01 18:49        
     
okay..so you know these mob wars here in middleEast when they fire from Mits-AT or TOW tripod and they leave it and run away
i have tried to do this in arma 2 but no use .
do you know how to do it ?
i really have a great idea
and thank you friends


Author Message


Posts: 1474
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2012-08-01 21:34        
     
Place in the init of the unit.
this addEventHandler ["fired",{ unassignVehicle  (gunner (_this select 0)); [(gunner (_this select 0))] orderGetIn false ; (gunner (_this select 0))  action ["getout",(_this select 0)];gunner (_this select 0) domove getpos player} ];


The move at the end will need to be a place of your choosing.


Advertisement


Author Message


Posts: 23
Rank:


Level: Hidden

Country: iq
Location:
Occupation:
Age: 22
In-game name: Mohammed

 
#3 Posted at 2012-08-01 23:59        
     
it's really hard for me to understand this code (i'm quite new in scripting ) if it's okay...can you explane how to make it work i tried but no use :-( :-(


Author Message


Posts: 1474
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2012-08-02 00:30        
     
It does work for me as is but I've noticed that I left the action command in, it's not needed.

Have it placed in the static gunners init and then when he fires the weapon the code has him exit the gun.

this bit pushes him out
unassignVehicle  (gunner (_this select 0)); [(gunner (_this select 0))] orderGetIn false ;

_this select 0 is the name of the gun, it's done this way so you don't have to keep changing the name through out the code.

This code can be placed in any static gunner (action now removed)
this addEventHandler ["fired",{ unassignVehicle  (gunner (_this select 0)); [(gunner (_this select 0))] orderGetIn false ;gunner (_this select 0) domove getpos player} ];

This will require the static weapon be named gun1 but if you place in another unit you would need to change the name to match. A little more readable but just the same really.

this addEventHandler ["fired",{ unassignVehicle  gunner gun1; [gunner gun1] orderGetIn false ;gunner gun1 domove getpos player} ];


One other simple way to do this would be to destroy the weapon after use.
this addEventHandler ["fired",{(_this select 0) setdamage 1; gunner (_this select 0) domove getpos player}];

this bit just tells the unit to move somewhere, in this example to the player
gunner (_this select 0) domove getpos player

I've only tested in OA but it should work for ARMA 2


Author Message


Posts: 23
Rank:


Level: Hidden

Country: iq
Location:
Occupation:
Age: 22
In-game name: Mohammed

 
#5 Posted at 2012-08-02 02:14        
     
dude you are the one lolz
is all of the english people that cool ?? :-D :-D
you helped me lot bro
so all of the codes contain [fired] that means (if fired do the following .....)
it's a bit complicated at first but it's really easy
anyway going for the test....

Added 16 minutes later:

thank you very much all of the codes are working but this
{(_this select 0) setdamage 1; gunner (_this select 0) domove getpos player}];
usually kills the gunner as well
cheers *YAHOO* *YAHOO* *YAHOO*

This post was edited by Napoleonm97d (2012-08-02 02:37, ago)


Author Message


Posts: 1474
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#6 Posted at 2012-08-02 03:00        
     
It works ok here maybe it has something to do with the type of weapon being damaged.

It would be possible to fix that but you may just as well use the codes that work.

Have Fun.