IF or SWITCH?
#1

Hi everyone. I want to ask you what is better to use.

In callback OnPlayerSpawn i have random spawn function which detect position by Team

pawn Code:
if (Team == T_MEDIC)
    {
        SetPlayerPosEx(playerid, MedicPos[Pos][0], MedicPos[Pos][1], MedicPos[Pos][2], MedicPos[Pos][3]);
    }
    else if (Team == T_FARMER)
    {
    ....
should i use switch, or if ?
pawn Code:
switch(Team)
{
    case T_MEDIC: SetPlayerPosEx(playerid, MedicPos[Pos][0], MedicPos[Pos][1], MedicPos[Pos][2], MedicPos[Pos][3]);
    case T_FARMER: ....
Reply


Messages In This Thread
IF or SWITCH? - by Channeru - 25.11.2012, 15:59
Re: IF or SWITCH? - by Nordic - 25.11.2012, 16:04
Re: IF or SWITCH? - by Konstantinos - 25.11.2012, 16:08
Re: IF or SWITCH? - by Crypt - 25.11.2012, 16:15
Re: IF or SWITCH? - by Channeru - 25.11.2012, 16:19

Forum Jump:


Users browsing this thread: 3 Guest(s)