OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: D.murphy man on 11 Apr 2003, 12:16:08

Title: Counter?
Post by: D.murphy man on 11 Apr 2003, 12:16:08
Hey all,

I was woundering how might a script a counter?
Like a thing that would add and subtact numbers so i could make my own little scoring system.
Allso i would like to know how i actully add and subtract numbers from it.

Thnx,
      Murphy.
Title: Re:Counter?
Post by: macguba on 11 Apr 2003, 12:24:25
Search the forums for money or scoring scripts, they might help.  In the meantime, does this help?    Syntax not guaranteed.    Check the command ref for more info on the commands - arithmetic functions and the like at at the beginning, before A.

#loop
_score=0
? (getdammage loon1) > 0.5:_score=_score+2
~2
? someVariable:_score=_score-1
? _score<0:exit
? _score>5:goto "win"
goto "loop"

#win
hint "You won!"
~3
endVariable=true
exit