Are you sure sCommand contains what you expect it to? This works fine for me:
sscanf("quit", "qu%*s");
(1) Result: 1
Although I probably would have used
if(has_prefix("quit", sCommand))
instead.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2004-01-10 10:27: Subject: sscanf()
Hello it seems as if I am having a tiny little problem with sscanf(). I am trying to match the input given to a string via sscanf. It's a simple little deal but the format I am using obviously isn't working although it has in the past. Here is the code snippet:
if(sscanf("quit", sCommand + "%*s"))
Now what I am trying to accomplish is to see if the player typed anything pertaining to the word quit. I.E q, qu, qui or even quit itself....Yes why not do a simple if/else. Well because there will be other commands that can be executed that will be longer. Am I setting this up wrong? It has worked in the past outside of pike but still in LPC. I even tried search("quit", sCommand) and that seemed to only return -1 no matter what I typed. Thanks in advance all.
Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
/ Brevbäraren