Andy455 11 Posted December 21, 2009 So in my mission I have a trigger activated by 'Radio Alpha' and when activated should do: _sm1 = ["SideM1"] execVM "Scripts\Radio.sqf"; The activation part works fine (I've tested without the switch), it just wont do anything if it is there :-/ Scripts\Radio.sqf: _type = this select 0; switch (_type) do { case SideM1: { pl1 sidechat "HQ, this is Eagle One message, over."; sleep 4; HQ sideChat "Eagle One this is HQ, go ahead over."; sleep 3; pl1 sideChat "We have found a guerilla truck in a warehouse located at grid: 065125, permission to destroy it, over."; sleep 5; HQ sideChat "Permission granted, same goes for any other NAPA assets you find, over and out."; sleep 4; pl1 sideChat "Roger that, out"; }; case SideM2: { pl1 sidechat "HQ, this is Eagle One message, over."; sleep 4; HQ sideChat "Eagle One this is HQ, go ahead over."; sleep 3; pl1 sideChat "We have found maps regarding NAPA hideouts & weapons caches in Chernarus, what shall we do with it? Over."; sleep 4; HQ sideChat "Good job Eagle One, retrieve them and continue on your mission, over & out."; sleep 3; pl1 sideChat "Roger, out."; }; case SideM3: { pl1 sidechat "HQ, this is Eagle One message, over."; sleep 4; HQ sideChat "Eagle One this is HQ, go ahead over."; sleep 3; pl1 sideChat "We have found several anti-vehicle mines on the road through the factory, what shall we do? Over."; sleep 5; HQ sideChat "Send in an engineer to safely disarm the mines and keep an eye out for more, over & out."; sleep 4; pl1 sideChat "Copy that, over & out."; }; default { pl1 sidechat "HQ, this is Eagle One message, over."; sleep 4; HQ sideChat "Eagle One this is HQ, go ahead over."; sleep 3; pl1 sideChat "We have found a guerilla truck in a warehouse located at grid: 065125, permission to destroy it, over."; sleep 5; HQ sideChat "Permission granted, same goes for any other NAPA assets you find, over and out."; sleep 4; pl1 sideChat "Roger that, out"; }; }; Where pl1 and HQ are both men already placed on the map. I have also tried it where SideM1 was in quotes like this: "SideM1" and it still didn't work HELP! :( Share this post Link to post Share on other sites
shuko 58 Posted December 21, 2009 First thing.. _type = this select 0; to _type = _this select 0; Second, if you pass a string, the cases need to be strings as well. Share this post Link to post Share on other sites
Andy455 11 Posted December 21, 2009 Thanks a bunch mate worked fine, damn local variables :P Share this post Link to post Share on other sites