Hello all :) I'm working on a mission where you command a squad and have to defend a base from incoming enemies... I've added actions to the player with the addaction command so the player can put out three t72 tanks and to use them to defend the base...
But I have a problem with my script: It creates the tanks ok, but the player can create dozens of tanks and I want the script to limit this to 3 tanks..
Here's the code from the init.sqs and the tank.sqs
Init.sqs:
_t = 0;
savevar "_t";
tank.sqs:
#starthere
? _t >= 3 : goto "ending";
_pos = [getpos ap select 0, (getpos ap select 1) +6, (getpos ap select 2) +200];
_tank = "T72" CreateVehicle _pos;
_tank SetPos _pos;
_tank SetDir (GetDir ap);
_t = _t + 1;
savevar "_t";
exit
#ending
ap removeaction _tank;
hint "3 tanks placed. . .";
exit
Any script aces here??
Any help appreciated...
And by the way..
I know it's supposed to be very easy... But I never get if-then-(else) to work in my scripts... Anyone who want to explain me (as the retard I am) how to construct and use if-then-else sentences in OFP..
1000's of thnx in advance
Me Out