Jump to content
Sign in to follow this  
bardosy

Increment a variable: "Invalid number in expression" error

Recommended Posts

I created a group of units in SQF script and then add a killed eventHandler to all of them:

 

{
	_x addEventHandler ["Killed", {
		params ["_unit", "_killer"];
		hullaszamlalo = hullaszamlalo + 1;
	}];
} forEach (units _group_i):

"hullaszamlalo" is a global variable, what is zero in init.sqf

But when the create units script run, I got a  "Invalid number in expression" error to "...o + 1;"  It sounds like I cannot add one to a variable.

Probably a noob mistake. Need a rubberduck to point to my noobness.

Share this post


Link to post
Share on other sites

Publish initialization code of hullaszamlalo var and the full error message.

  • Thanks 1

Share this post


Link to post
Share on other sites

OMG, you are the best rubberduck! Thank you!!! When I search for the error msg, I found out the problem:

 

} forEach (units _group_i):

It's not a comma in the end of this line.

Sorry for annoying, but thank you very much!!!!

 

  • Haha 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×