using switch
#1

can someone help me with this code?

Код:
		zang = floatround(zang);
		switch(zang)
		{
			case 0: SendClientMessage(playerid,0xFFFFFFFF,"test1");
			case 1 .. 89: SendClientMessage(playerid,0xFFFFFFFF,"test2");

			case 90: SendClientMessage(playerid,0xFFFFFFFF,"test3");

			case 91 .. 179: SendClientMessage(playerid,0xFFFFFFFF,"test4");

			case 180: SendClientMessage(playerid,0xFFFFFFFF,"test5");

			case 181 .. 269: SendClientMessage(playerid,0xFFFFFFFF,"test6");

			case 270: SendClientMessage(playerid,0xFFFFFFFF,"test7");

			case 271 .. 359: SendClientMessage(playerid,0xFFFFFFFF,"test8");

		}
i haven't provided all of it for obvious reasons, but the main problem is is that it doesnt detect the .. case's, so test2, test4, test6 and test8 dont come up. it is using a rounded zang which i get from GetPlayerFacingAngle, so i dont know why it doesnt work :\

can anyone explain why it doesnt work for test2, test4, test6 and test8? and provide a working example?
Reply


Messages In This Thread
using switch - by kazai - 30.10.2009, 07:59
Re: using switch - by Sergei - 30.10.2009, 08:09
Re: using switch - by kazai - 30.10.2009, 08:13
Re: using switch - by Google63 - 30.10.2009, 10:34

Forum Jump:


Users browsing this thread: 2 Guest(s)