• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[GU?A] Usos de switch.
#11
Util, pero te falta explicar:

->Que los switch solo son num?ricos (integers).

->Que no es necesario usar un random.

ejemplo:

Code:
new i[MAX_PLAYERS];

i[playerid];
new string[12];
switch(i[playerid])
{
? ? ?case 1: string = "I = 1";
? ? ?case 2: string = "I = 2";
? ? ?case 3: string = "I = 3";
     case 4 .. 5: string = "I = 4 o 5";
}

y que es la forma mas optimizada de hacer todos
Code:
if(isnull(var))
{
}
else if(var == 1)
{
}
....
  Reply


Messages In This Thread
[GU?A] Usos de switch. - by klays - 2019-04-14, 03:19 AM
RE: [GU?A] Usos de switch. - by Mugsy - 2019-04-14, 10:09 AM
RE: [GU?A] Usos de switch. - by G0NZ4L0 - 2019-04-14, 03:43 PM
RE: [GU?A] Usos de switch. - by Erziok - 2019-04-14, 03:47 PM
RE: [GU?A] Usos de switch. - by Keizer - 2019-04-15, 01:43 AM
RE: [GU?A] Usos de switch. - by #Fede - 2019-04-15, 04:48 AM
RE: [GU?A] Usos de switch. - by klays - 2019-04-15, 10:09 PM
RE: [GU?A] Usos de switch. - by Graber - 2019-04-15, 12:48 PM
RE: [GU?A] Usos de switch. - by Autorojo - 2019-04-15, 03:19 PM
RE: [GU?A] Usos de switch. - by MaikPlay_YT - 2019-04-15, 10:44 PM
RE: [GU?A] Usos de switch. - by DarkThinking - 2019-05-30, 04:55 PM
RE: [GU?A] Usos de switch. - by Markski - 2019-05-30, 04:57 PM

Forum Jump: