Jump to content
DMFalke

CfgNotifications error. Can't find the problem.

Recommended Posts

Trying to make notifications. Arma returns "missing semicolon on line 2", but there is clearly different problem. Code:

 

Techincally, is ctrl-c, ctrl-v from bohemia docs. Code reach line 2 for sure, but after that I have no idea.

//////////////////// NOTIFICATIONS //////////////////////////////
class CfgNotifications		// error here "class [#]CfgNotifications"
{
	class Default
	{
		title = "";
		iconPicture = "";
		iconText = "";
		description = "";
		color [] = {1,1,1,1};
		duration = 5;
		priority = 0;
		difficulty[] = {};
	};
	
	class TaskCompleted1
	{
		title = "TASK COMPLETED";
		iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcon_ca.paa";
		description = "Poor vehicle.";
	};
};

//////////////////// NOTIFICATIONS END ////////////////////////////

Please tell me, that I missed something obvious. I tried to comment out line by line, but for no succes.

Share this post


Link to post
Share on other sites
8 minutes ago, DMFalke said:

color [] = {1,1,1,1};

 

I don't think this space between color and [] is allowed. Remove it and try again.

Share this post


Link to post
Share on other sites
1 minute ago, POLPOX said:

I don't think this space between color and [] is allowed. Remove it and try again.

tried "color[] = {1,1,1,1};" without space. Same. 

Share this post


Link to post
Share on other sites

init.sqf

Spoiler

#include <notifications.sqf>

hint "test is loaded";

crate_01 = [["vn_m16_20_mag", 4],
				["vn_m16",3]];			
			
for "_i" from 0 to (count crate_01 -1) do {			
	buffer = crate_01 select _i;					
	ammo_crate_01 addItemCargo [(buffer select 0),(buffer select 1)];
	};

[] spawn {
	while {true} do{
		if (!("vn_m16_20_mag" in magazineCargo ammo_crate_01)) then{
			ammo_crate_01 addItemCargo ["vn_m16_20_mag", 7];
			};
		sleep 10;
	};
};
// Destroy vehicle
[] spawn {
	while {true} do{
		waitUntil {sleep 10; !alive Vehicle_01};
		hint "Yep, it's destroyed.";
		[notifications::"TaskCompleted1",[]] call BIS_fnc_showNotifications;
	};
};

 

 

notifications.sqf:

Spoiler

//////////////////// NOTIFICATIONS //////////////////////////////
class CfgNotifications		// error here "class [#]CfgNotifications"
{
	class Default
	{
		title = "";
		iconPicture = "";
		iconText = "";
		description = "";
		color[] = {1,1,1,1};
		duration = 5;
		priority = 0;
		difficulty[] = {};
	};
	
	class TaskCompleted1
	{
		title = "TASK COMPLETED";
		iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcon_ca.paa";
		description = "Poor vehicle.";
		priority = 1;
	};
};

//////////////////// NOTIFICATIONS END ////////////////////////////

 

 

Edited by DMFalke
code correction

Share this post


Link to post
Share on other sites

Thank you. As I though, I tried  put squared peg in triangle hole. 

  • 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

×