10.02.2014, 13:13
Is the default in switch the same as else in 'if' ?
Example, are these two the same?
And
Example, are these two the same?
pawn Код:
case 4:
{
if(PlayerInfo[playerid][pNote5s] == 1)
{
strmid(PlayerInfo[playerid][pNote5], "None", 0, strlen("None"), 255);
PlayerInfo[playerid][pNote5s] = 0;
SCM(playerid, COLOR_WHITE, "Note (slot 5) has been deleted successfuly.");
}
else return SCM(playerid, COLOR_GREY, "** You don't have a note at slot 5 ! ");
}
default: return SCM(playerid, COLOR_GREY,"You can only choose between note 1-5!");
pawn Код:
if(blahblah)
{
if(PlayerInfo[playerid][pNote5s] == 1)
{
strmid(PlayerInfo[playerid][pNote5], "None", 0, strlen("None"), 255);
PlayerInfo[playerid][pNote5s] = 0;
SCM(playerid, COLOR_WHITE, "Note (slot 5) has been deleted successfuly.");
}
else return SCM(playerid, COLOR_GREY, "** You don't have a note at slot 5 ! ");
}
else return SCM(playerid, COLOR_GREY,"You can only choose between note 1-5!");