The script works now. Sa8gecko gave me the idea to try and monkey with the coding. The script now goes like this:
; Bombarding
; Run from mission:
; [who, A, B, C, "Name"] exec "Artillery.sqs"
; who - who runs the script (can be anybody)
; A - how many bombs
; B - diameter of "Area bombed"
; C - timout between two bombs
; D - name of the marker, which is in the middle of the "Area bombed"
_d = getmarkerpos (_this select 4);
_i = 0;
_a = _this select 1;
_b = _this select 2;
_c = _this select 3;
#LOOP
_bomb = "heat120" camcreate _d;
_e = random _b;
_bomb setpos [(_d select 0) - _b/2 + random _b, (_d select 1) - _b/2 + random _b]
_bomb setdammage 1;
~(random _c)
_bomb setdammage 0;
~(random _c)
_i = _i+1;
? _i < _a : goto "LOOP"
deleteVehicle _bomb;
exit