30.10.2009, 07:59
can someone help me with this code?
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?
Код:
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"); }
can anyone explain why it doesnt work for test2, test4, test6 and test8? and provide a working example?