sscanf(2.0) and IRC command
#2

Man, it's pretty simple:

pawn Код:
// Let's make a 3 parameters exaple

new
  a[10],
  b[10],
  c[10];

#define Z 8 // sizeof

if(sscanf(string, "s["#Z"]", a))
{
  // the stuff to join the channel
}
else if(sscanf(string, "s["#Z"]s["#Z"]", a, b))
{
  // this is what happens if he typed the first param but not the second
}
else if(sscanf(string, "s["#Z"]s["#Z"]s["#Z"]", a, b, c))
{
  // this is what happens if he types the first and the second but not the third
}
else
{
  // this is what happens if he typed all the params
}
Reply


Messages In This Thread
sscanf(2.0) and IRC command - by dcmd_crash - 29.04.2010, 01:03
Re: sscanf(2.0) and IRC command - by Miguel - 29.04.2010, 02:08
Re: sscanf(2.0) and IRC command - by dcmd_crash - 29.04.2010, 02:15

Forum Jump:


Users browsing this thread: 1 Guest(s)