OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 456820 on 30 Dec 2005, 22:36:08
-
for some reason i cant remember this ive searched the forum quickly but found nothing and it just has seem to of gone from my mind
But anyway how can i check when my sniper has only 2 Magazines of his M21 left it doesnt matter about his sidearm just his primary weapon ?
Thanks
-
Try this script:
_i = count magazines player
_j = 0
_n = 0
#Loop
?_j==_i : goto "check"
?(magazines player select _j) == "M21": _n=_n+1
_j=_j+1
~.01
goto "Loop"
#Check
?_n <= 2: goto "hint"
_j=0
_n=0
_i = count magazines player
~.01
goto "Loop"
#Hint
hint format ["You have %1 magazines left", _n]
exit
-Pilot
-
ahh that could be why i couldnt remember it i didnt know it needed a script oh well
Thanks anyway ill have to try that out tomorow ill report back ASAP
And another thing this doesnt check for ammo as in the number of rouns just the mag
Say i had 2 mags but one mag had 10 rounds in would it still trigger as 2 mags
Just checking
Cheers
-
And another thing this doesnt check for ammo as in the number of rouns just the mag
Say i had 2 mags but one mag had 10 rounds in would it still trigger as 2 mags
Just checking
No, the script doesn't check to see how many shots are left in each mag. It is possible for the player to have two mags with only one bullet in each. I have no idea how to check for individual bullets...and something tells me it can't be effectively done.
-Pilot
-
works perfectly thanks Pilot
Topic solved