Jump to content
Sign in to follow this  
hogmason

adding public varable issue

Recommended Posts

so i am adding a public variable to my composition base but i keep getting an error but everything looks to be fine

this is the code

[color="#FF0000"]if (isnil "radar_active") then {radar_active = 0;};[/color]


 [color="#FF0000"]radar_active = 1; publicvariable "radar_active";[/color]

_radarbunker = [(getMarkerPos "campbase"), random 360, "radar_site_ru1"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

		[color="#FF0000"]_radarbunker addeventhandler ["killed", { radar_active = 0;publicvariable "radar_active"; [sgt,nil,rgroupChat,"Enemy radar has been destroyed"] call RE;}];[/color]
           _radarbunker setVehicleInit "_radarbunker addEventHandler [""HandleDamage"",{(_this select 4) == ""PipeBomb""}]" ;format ["%1 = this; this setVehicleVarName ""%1""",_radarbunker];
           processInitCommands;	


this is the error

Warning Message: Script  not found
Error in expression <ipts\objectMapper.sqf"));

_radarbunker addeventhandler ["killed", { radar_activ>
 Error position: <addeventhandler ["killed", { radar_activ>
 Error addeventhandler: Type Array, expected Object
File C:\Users\natho\Documents\ArmA 2 Other Profiles\=Mason=\missions\Operation_HOG_V_3.Chernarus\missions\spawners\Targets\RADAR_base.sqf, line 27


Share this post


Link to post
Share on other sites

You! Again!

Looks like it's more your eventhandler that's causing the issue.

_radarbunker is an array of objects, not an object, hence the error.

Use select to select the object you want.

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  

×