>= in cases?
#1

Hello guys,

I'm having a bit of a strugle with my switch, basicly what i want is when the exp case is between 0 and 500 it will show
"amount of exp/500" but i cant seem to get the structure right.
pawn Код:
switch(User[playerid][USER_EXP])
{
    case 0: format(InfoString, sizeof(InfoString), "Exp: ~w~%d/500", tdexp) && PlayerTextDrawSetString(playerid,     exp[playerid], InfoString);
    case 500: format(InfoString, sizeof(InfoString), "Exp: ~w~%d/1500", tdexp) && PlayerTextDrawSetString(playerid, exp[playerid], InfoString);
}
//I tried stuff like
case 0 || 500:
//But i tested it and it won't work, i also checked the wiki for this but no help.
What would be the correct way to do this?

thanks.
Reply
#2

pawn Код:
case 0 .. 500
That.
Reply
#3

Quote:
Originally Posted by Tagathron
Посмотреть сообщение
pawn Код:
case 0 .. 500
That.
Thank you.
Reply
#4

that'd be 0 to 500, if you only want 0 or 500 use a comma

case 0, 500:
Reply
#5

Quote:
Originally Posted by cessil
Посмотреть сообщение
that'd be 0 to 500, if you only want 0 or 500 use a comma

case 0, 500:
I want 0 till 500 so I guess this is good, thanks for your reply!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)