Switches & Cases! - 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)
+--- Thread: Switches & Cases! (
/showthread.php?tid=530707)
Switches & Cases! -
Juvanii - 08.08.2014
How to make 'else' function under switches?
pawn Код:
switch(something)
{
case 0: text = "something";
case 1: text = "something";
else ...
}
Re: Switches & Cases! -
DiGiTaL_AnGeL - 08.08.2014
You can't. But you can use this:
pawn Код:
switch(something)
{
case 0: text = "something";
case 1: text = "something";
case 2..10: text ="change 10 to the last possible value of your variable";
}
Re: Switches & Cases! -
]Rafaellos[ - 08.08.2014
I'm not sure if this is what you mean, but default will work as else.
pawn Код:
switch(something)
{
case 0: text = "something";
case 1: text = "something";
default: text = "Nothing from the above";
}
Re: Switches & Cases! -
Don_Cage - 08.08.2014
Default is like else
pawn Код:
switch(something)
{
case 0: text = "something";
case 1: text = "something";
default: text = "something";
}
EDIT: too late
Re: Switches & Cases! -
Juvanii - 08.08.2014
Worked! Thanks all..