Switch + else? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Switch + else? (
/showthread.php?tid=184222)
Switch + else? -
CrucixTM - 18.10.2010
Is following possible:
pawn Код:
switch(casenr)
{
case 1:
{
blabla case stuff
}
}
else return SendClientMessage(playerid, COLOR_GREY, "INVALID CASE#");
return 1;
I'm not sure if a switch works with "else".
Re: Switch + else? -
[NoV]LaZ - 18.10.2010
It doesn't, but
default does.
pawn Код:
switch ( casenr )
{
case 1:
case 2:
default: // if case 1 and case 2 fail
}
Re: Switch + else? -
CrucixTM - 18.10.2010
Quote:
Originally Posted by [NoV]LaZ
It doesn't, but default does.
pawn Код:
switch ( casenr ) { case 1: case 2: default: // if case 1 and case 2 fail }
|
Superb, thanks