Switch is faster than If?
#4

Example:

I Have a JOB System.

for this:
PHP код:
if(JOB == 1) return SendClientMessage(playerid, -1"PizzaBoy");
if(
JOB == 2) return SendClientMessage(playerid, -1"Fisherman");
if(
JOB == 3) return SendClientMessage(playerid, -1"Lumberjacker");
if(
JOB == 4) return SendClientMessage(playerid, -1"Seller"); 
can i use this:
PHP код:
switch(JOB)
{
case 
1SendClientMessage(playerid, -1"PizzaBoy");
case 
2SendClientMessage(playerid, -1"Fisherman");
case 
3SendClientMessage(playerid, -1"Lumberjacker");
case 
4SendClientMessage(playerid, -1"Seller");

right?
Reply


Messages In This Thread
Switch is faster than If? - by rolex - 26.06.2017, 17:45
Re: Switch is faster than If? - by Toroi - 26.06.2017, 17:57
Re: Switch is faster than If? - by BiosMarcel - 26.06.2017, 17:58
Re: Switch is faster than If? - by rolex - 26.06.2017, 18:03
Re: Switch is faster than If? - by jlalt - 26.06.2017, 18:10
Re: Switch is faster than If? - by rolex - 26.06.2017, 18:13
Re: Switch is faster than If? - by jlalt - 26.06.2017, 18:30
Re: Switch is faster than If? - by rolex - 26.06.2017, 18:54
Re: Switch is faster than If? - by OneDay - 26.06.2017, 19:06
Re: Switch is faster than If? - by rolex - 26.06.2017, 19:21

Forum Jump:


Users browsing this thread: 2 Guest(s)