Yikes... some clunky work arounds here ;D
If you ever want to choose a random number between two values, just double the value then take away half.
eg.
randomnumber = (random 200) - 100
randomnumber = (random 400) - 200
randomnumber = (random 500) - 250
The first of those chooses a number between -100 and 100.
The second between -200 and 200.
The third between -250 and 500. You see?
No need for cumbersome ? : operations
Next... checking if the explosion is within 25 of the player...
Try something like this:
_counter=0
~5
#shelling
_cx = (_Explosion select 0) + (random (_spread * 2) - _spread)
_cy = (_Explosion select 1) + (random (_spread2 * 2) - _spread2)
_cz = _Explosion select 2
? (_cx < (getpos player select 0) + 25) and (_cx > (getpos player select 0) - 25) and (_cy < (getpos player select 1) + 25) and (_cy > (getpos player select 1) - 25): goto "shelling"
_tempObj = _AmmoType camCreate[_cx, _cy, _cz]
~0.01
_tempObj = objNull
_counter = _counter + 1
~3
?(_counter == _Shells):exit
goto "shelling"
So the crux of it is this nasty looking line here:
? (_cx < (getpos player select 0) + 25) and (_cx > (getpos player select 0) - 25) and (_cy < (getpos player select 1) + 25) and (_cy > (getpos player select 1) - 25): goto "shelling"
What that does is compare the randomly chosen shell position with that of the player. If they're within a 25m circle, it rechooses the position. This means you will
never get a shell landing closer than 25m to the player
Anyway, try that and see if it works as advertised...
[size=0.5]
Edit: typos in code are bad... mmk...[/size]