[SOLVED] Checking multiple variables for their values
#3

pawn Код:
stock split(const strsrc[], strdest[][], delimiter)
{
  new li;
  i = 0;
  new aNum;
  new len;
  while(i <= strlen(strsrc))
  {
    if(strsrc[i] == delimiter || i == strlen(strsrc))
    {
      len = strmid(strdest[aNum], strsrc, li, i, 128);
      strdest[aNum][len] = 0;
      li = i+1;
      aNum++;
    }
    i++;
  }
  return 1;
}
So pretty much, do this.

pawn Код:
new data[4][10];
split(/*Source*/, data, ' ');
for(new i = 0; i<4; i++)
{
  if(strval(data[i]) == /*Value here*/)
  {
  //One of the numbers is a certain number
  }
}
Reply


Messages In This Thread
[SOLVED] Checking multiple variables for their values - by CaHbKo - 28.02.2010, 17:25
Re: [HELP] Checking multiple variables for their values - by smeti - 28.02.2010, 17:36
Re: [HELP] Checking multiple variables for their values - by [HiC]TheKiller - 28.02.2010, 17:37
Re: [HELP] Checking multiple variables for their values - by CaHbKo - 28.02.2010, 17:45
Re: [HELP] Checking multiple variables for their values - by smeti - 28.02.2010, 18:11
Re: [HELP] Checking multiple variables for their values - by CaHbKo - 01.03.2010, 12:04

Forum Jump:


Users browsing this thread: 1 Guest(s)