Yeah Spinor,
i just made some tests, and figured out that OFP's engine is
a little bit mixed up, when it comes to such operations.
a = player setdammage 0.999
hint format ["%1",a]
makes the player go prone (bloody)
while:
player setdammage 0.999 = player setdammage (1 - 0.001)
makes nothing but : error unknown operator
But then again i tried another thing:
a = (player setdammage (getdammage player + 0.48) == player setdammage (getdammage player + 0.48))
hint format ["%1",a]
This time it made the player go prone (bloody), what means
the both setdammage commands have become executed,
as getdammage player + 0.48 executed one time would
not make him prone (i remember the prone line to be around
0.9 or so).
Result of the hint was: scalar bool array string 0xfcffffef
While i also tried:
b = (1 + 5) == (2 + 4)
hint format ["%1",b]
Result was: true
showed as a hint
and:
b = (1 + 5) == (2 + 5)
hint format ["%1",b]
Result was: false
So it looks like OFP understands math equations, but not
logical ones, like i did with the commands.
Off course it's true what you said Spinor about my last reply,
but without testing that, i was just trying to explain where
this "strange behaviour" in arrays is comming from.
And in case of assigning a command to an array or variable,
it still makes some sense what i said above (it's just that
it's also hard for me to talk about algebra in a language, i weren't born with).
Summary:
a = command
or
a = math operation
will do the same thing
a will be the result of the stuff after "=", what means
operation will be executed and then assigned to be: a
It's just that you are limited in some ways, so that it's
not possible to assign everything you want to a.
hope if somebody reads that, it still makes sense, as i'm
not sure, if i got lost somewhere between my sentences ;D
:edit - btw - General Barron u bugger,
i just figured out that u made me loose two hours of my day,
just to find out something i don't really find to be useful in
any way
Nah m8 - it's always good to take a look behind the scene,
that helps sometimes understanding why some things do
not work, and other do.
~S~ CD