Some noob questions. :)
#2

If you're gonna use "if" you'll need to do it like this:
pawn Код:
if(classid == 105 || classid == 106 || classid == 107)
But wait, there's an easier way!
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
  switch(classid)
  {
    case 105, 106, 107:
    {
     // code
    }
    case 108:
    {
      // code for if(classid == 108)
    }
    case 109 .. 120: // this mean from 109 to 120 (if (classid == 109 || classif == 110...)
    {
      // code
    }
    default: // this is "else"
    {
      // code
    }
  }
  return 1;
}
I'd do it like:

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
  switch(classid)
  {
    case 105 .. 107: gTeam[playerid] = TeamGrovest;
  }
  return 1;
}
Reply


Messages In This Thread
Some noob questions. :) - by enkei - 19.02.2010, 01:51
Re: Some noob questions. :) - by Miguel - 19.02.2010, 02:35
Re: Some noob questions. :) - by enkei - 19.02.2010, 17:13
Re: Some noob questions. :) - by enkei - 20.02.2010, 15:34
Re: Some noob questions. :) - by VonLeeuwen - 20.02.2010, 15:42
Re: Some noob questions. :) - by enkei - 20.02.2010, 17:16
Re: Some noob questions. :) - by VonLeeuwen - 20.02.2010, 17:21
Re: Some noob questions. :) - by enkei - 20.02.2010, 19:34
Re: Some noob questions. :) - by enkei - 21.02.2010, 15:13
Re: Some noob questions. :) - by enkei - 21.02.2010, 19:21

Forum Jump:


Users browsing this thread: 5 Guest(s)