Hi, I have some problems with a sqf script that im making.
The problem, is that when I select the location to be a marker,
nothing happens and when I set the location to be a tank for example,
it blows up even if the ammo type used was "B_30mmA10_AP"
here is a download link
http://dl.dropbox.com/u/5921391/MyIED.sqfand here is the code
/* IED Script
By Zouloum
V0.1 July 13, 2011
This script will create an explosion of a
selected size on any object when called.
The arguments are [objectName, explosionPower]
Explosion Power will be 1 of 8 choices:
Tiny - Will injure the legs of the player if standing.
It will kill the player if crouching or prone.
VerySmall - Will kill anybody in a 5 meter radius.
It is as effective as a frag grenade.
Small - Will disable some unarmored vehicles
without killing the occupants.
Medium - Will disable any unarmored and
damage lightly armored vehicles.
Large - Will destroy unarmored vehicles, disable
lightly armored vehicles and damage heavily
armored vehicles.
Huge - Will usualy destroy anything.
Insane - Will destroy anything instantly
Smoke - Doesn't do any damage, just pops big
amount a smoke.
Example : nul = [thisMarker, "Insane"] execVM "MyIED.sqf";
or : nul = [theCar, "Small"] execVM "MyIED.sqf";
*/
_target = _this select 0;
_explosion = _this select 1;
//Coordinates of the IED
_iedPos = GetPos _target;
_iedPosX = _iedPos select 0;
_iedPosY = _iedPos select 1;
_iedPosZ = _iedPos select 2;
//The main part
if(_explosion == "Tiny") then {
_ammoType = "B_30mmA10_AP";
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_target setDamage 1;
};
if(_explosion == "VerySmall") then {
_ammoType = "grenade";
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_target setDamage 1;
};
if(_explosion == "Small") then {
_ammoType = "R_57mm_HE";
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_target setDamage 1;
};
if(_explosion == "Medium") then {
_ammoType = "M_Sidewinder_AA_F35";
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_target setDamage 1;
};
if(_explosion == "Large") then {
_ammoType = "Sh_125_HE";
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_target setDamage 1;
};
if(_explosion == "Huge") then {
_ammoType = "Bo_GBU12_LGB";
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_target setDamage 1;
};
if(_explosion == "Insane") then {
_ammoType = "Bo_GBU12_LGB";
_ammoType createVehicle[_iedPosX + 15, _iedPosY + 15, iedPosZ];
_ammoType createVehicle[_iedPosX + 15, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY + 15, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX - 15, _iedPosY -15, iedPosZ];
_ammoType createVehicle[_iedPosX -15, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY -15, iedPosZ];
_target setDamage 1;
};
if(_explosion == "Smoke") then {
_ammoType = "SmokeLauncherAmmo";
for [{_i = 0},{_i <= 3},{_i = _i+1}] do {
_ammoType createVehicle[_iedPosX + 15, _iedPosY + 15, iedPosZ];
_ammoType createVehicle[_iedPosX + 15, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY + 15, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX - 15, _iedPosY -15, iedPosZ];
_ammoType createVehicle[_iedPosX -15, _iedPosY, iedPosZ];
_ammoType createVehicle[_iedPosX, _iedPosY -15, iedPosZ];
_target setDamage 1;
sleep 30;
};
};