Home   Help Search Login Register  

Author Topic: variable addition  (Read 493 times)

0 Members and 1 Guest are viewing this topic.

norbe

  • Guest
variable addition
« on: 19 Sep 2005, 00:55:41 »
Hello to you all,

Just a quick question, i'm making a map in which im going to count the amount of tanks destroyed, and once the total number reaches a certain amount (probably four, i havn't decided that yet) it triggers a script. I know that the best way to use this would be to use an integer variable, but im unsure of the correct syntax to use when adding to the variable.

I tried

TanksKilled = TanksKilled + 1

but it didn't seem to work, i also tried

TanksKilled + 1 = TanksKilled

but that didn't work either.

Help would be greatly appreciated.

Norbe


UNN

  • Guest
Re:variable addition
« Reply #1 on: 19 Sep 2005, 01:14:48 »
Hi,

In your missions init.sqs, make sure you have:

Code: [Select]
TansKilled=0
If you don't, OFP won't know TanksKilled is supposed to be a number.

norbe

  • Guest
Re:variable addition
« Reply #2 on: 19 Sep 2005, 01:24:32 »
Brilliant, put it in the init.sqs and it works, huzzah.

thanks for your help UNN.

Norbe.