Jump to content
Sign in to follow this  
Andy455

Help with Switch

Recommended Posts

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×