Grouping Skins
#7

Quote:
Originally Posted by Robert_Crawford
Посмотреть сообщение
Actually you mean your code would be?
pawn Код:
if(GetPlayerSkin(playerid) == 276 || 274 || 275 || 275 || 277 ||278 || 279)
I would use a switch for that very reason. If you use an if statement it and have a lot of skins to go through it will gain length pretty fast. With an if statement you could do

case 274..279: return true;

It wont take as much space and will be more efficient



P.S.

What 274..279 means is 274-279. It checks 274, 275, 276, etc.

0..100 would be 0 to 100

default: is basically an else statement. if it isn't any of the cases, it will do the default action which is return false;
Reply


Messages In This Thread
Grouping Skins - by Robert_Crawford - 12.03.2012, 19:10
Re: Grouping Skins - by MP2 - 12.03.2012, 19:12
Re: Grouping Skins - by [ABK]Antonio - 12.03.2012, 19:13
Re: Grouping Skins - by MP2 - 12.03.2012, 19:17
Re: Grouping Skins - by Robert_Crawford - 12.03.2012, 19:35
Re: Grouping Skins - by MP2 - 12.03.2012, 19:40
Re: Grouping Skins - by [ABK]Antonio - 12.03.2012, 19:43
Re: Grouping Skins - by KingHual - 12.03.2012, 19:44
Re: Grouping Skins - by MP2 - 12.03.2012, 19:44
Re: Grouping Skins - by Robert_Crawford - 12.03.2012, 20:18

Forum Jump:


Users browsing this thread: 4 Guest(s)