Jump to content
Sign in to follow this  
BoltboxerPro

Sabotage Vehicle Script?

Recommended Posts

First off, sorry I am a noob at this. But I tried doing a script I require for a mission where you must sabotage the aircraft.

Basically all I want is that when you come to the aircraft there is an option for "Sabotage Aircraft" and when you click on it the aircraft's damage gets set to really low.

I tried doing this but it doesn't work:

this addaction ["Sabotage Aircraft", "damage.sqf"];

Then in damage.sqf

_airplane setDamage 0.1;

Does anybody have an idea what I'm doing wrong or is there an easier script to do this?

Thanks for any help I can get.

Share this post


Link to post
Share on other sites

Name the plane p1 or something easy to remember like that.

Then...

detTime = 7;

p1 removeAction sab;

Hint format ["Detonation in %1 seconds", detTime];

sleep detTime;

p1 setDamage 1;

(Setting damage to 1 will destroy it and 0.1 will slightly damage it, i'm not sure which you wanted to do. Also change detTime to an appropriate number so you can get away in time.)

Edited by StevoAU

Share this post


Link to post
Share on other sites
Name the plane p1 or something easy to remember like that.

Then...

Hint "Detonation in 5 seconds";
sleep 5;
[b]p1[/b] setDamage 1;

(Setting damage to 1 will destroy it and 0.1 will slightly damage it, i'm not sure which you wanted to do.)

Well, I fee stupid now. I though 0 was max damage and 1 was 100% health. :/ Well thanks for the answer. It works :)

Share this post


Link to post
Share on other sites

Hi BoltboxerPro

Could you paste the whole script you're using as an example?

This sounds like a good one and I'd like to use it if you don't mind.......

cheers

kk

Share this post


Link to post
Share on other sites
Hi BoltboxerPro

Could you paste the whole script you're using as an example?

This sounds like a good one and I'd like to use it if you don't mind.......

cheers

kk

No problem, the one I'm currently using for the mission is this:

(airplane) removeAction sab;

(player1) SwitchMove "RepairingKneel";

sleep 3;

Hint "Sabotaging...";

sleep 10;

airplane setDamage 0.9;

sleep 4;

(player1) SwitchMove "";

Hint "Aircraft Disabled";

Not much, but for a first script I'll take it.

In the init I put

sab= (airplane) addaction ["Sabotage Aircraft", "damage.sqf"];

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  

×