GetPlayerScore(Player(0), PLAYER_SCORE_UNITS_KILLED)
The game also keeps track of how many kills you have. If you don't need any specific conditions for the kills then you can useGetPlayerScore(Player(0), PLAYER_SCORE_UNITS_KILLED)
You have to keep count of each player's kills using an integer variable with an array.
E.g. Killcount[1] will be used for player 1, and so on.
Then, when an unit dies, you set Killcount[player number of owner of killing unit] to (Killcount[player number of owner of killing unit] + 1) to increase the count.
Finally, use a if/then/else to check whether Killcount[player number of owner of killing unit] is equal or greater to 10, and if so, trigger victory.
That's pretty basic but should do the trick.
Playerscore is accessed in GUI when choosing the value of an integer (number without fractions). Inside the popup menu to select the value go to the category player. Look for something like "Player - Player Score".Pardon me, but where do I find "GetPlayerScore", sorry just can't find it
Almost there, I believe your If should be "If kill_count[(player number of (owner of killing unit))] greater than or equal to 2", because right now it only checks what's the player number of the killing unit, not their kills![]()
In this case the OP doesn’t need to. In fact in most cases you can safely ignore the GUI array size. For all primitive variables (string, real, int, boolean) it’s unnecessary since loading an uninitialized index just returns “”, 0, or false. For handle (agent would be more generic) variables it will return null which is usually not a problem (though it can be).Also, you'll want to increase the array up to the maximum number of players in your map, otherwise it will only work for player 1.
what?In this case the OP doesn’t need to. In fact in most cases you can safely ignore the GUI array size. For all primitive variables (string, real, int, boolean) it’s unnecessary since loading an uninitialized index just returns “”, 0, or false. For handle (agent would be more generic) variables it will return null which is usually not a problem (though it can be).