[JASS] increment or decrement function

Status
Not open for further replies.
Level 3
Joined
Aug 25, 2012
Messages
30
Hello, I am totaly newbie to Jass, but i need a simple function, that when i call with integrer parameter, it increases/decreases it by 1, so I dont have to create a structures like this (there are +- 30 of these structures in my map, and more comming...)
  • Set PlayerKills[(Player number of (Owner of (Killing unit)))] = (PlayerKills[(Player number of (Owner of (Killing unit)))] + 1)
 
Thanks for response, i was only wondering if there is something similar to <variable>++ like in other programming languages i know (C#, Java, PHP, etc.)
 
No there isn't. Technically you can do it in zinc and cjass, but that is just interfaced. It ends up doing the same thing. Although, you can always make your own increment/decrement functions. But I only recommend doing that if you are comfortable with JASS.

You can't, at least for what is asked, being able to use an integer parameter, since functions arguments are taken as value, not as reference.
 
Status
Not open for further replies.
Back
Top