Making SSCANF optional
#4

Grim_'s code will work, But i noticed u asked for sscanf, here is a sscanf rebuild:

pawn Код:
COMMAND:stats(playerid, params[])
{
   new otherplayerid;
   if(isnull(params))
   {
       // Show player their own stats
   }
   else if(!sscanf(params, "u", otherplayerid))
   {
       // Show the 'otherplayerid' stats
   }
   else
   {
       SendClientMessage(playerid, -1, "USAGE: /stats [name/id]");
   }
   return 1;
}
Not tested. Should work.
Reply


Messages In This Thread
Making SSCANF optional - by emokidx - 10.08.2011, 04:30
Re: Making SSCANF optional - by Grim_ - 10.08.2011, 04:33
Re: Making SSCANF optional - by emokidx - 10.08.2011, 04:34
Re: Making SSCANF optional - by Godhimself - 10.08.2011, 06:56

Forum Jump:


Users browsing this thread: 1 Guest(s)