sscanf problem
#1

Hey there, i have little prob. I want 2 make /mute <id/nick> <lenght(optional)> <reason(optional)> command. I have this:
Код:
		sscanf(params,"rI(5)S[50]",ID,time,reason);
i want sth like this:
if is set only ID - mute player for no reason, 5 minuntes.
if is set time, but no reason - mute player for XX Time, with no reason.
if is set reason, but not time - mute player for 5 minutes with reason.
But when i do that, it doesn't work correctly. There are some warnings from console:
Quote:

[21:31:11] sscanf warning: No default value found.
[21:31:11] sscanf warning: Strings without a length are deprecated, please add a destination size.
[21:31:11] sscanf warning: Format specifier does not match parameter count.
[21:29:53] sscanf warning: Unknown format specifier '[', skipping.
[21:29:53] sscanf warning: Unknown format specifier ']', skipping.
[21:24:38] sscanf warning: Unknown format specifier '[', skipping.
[21:24:38] sscanf warning: Unknown format specifier '5', skipping.
[21:24:38] sscanf warning: Unknown format specifier '0', skipping.
[21:24:38] sscanf warning: Unknown format specifier ']', skipping.

etc. Any ideas? :\
Reply
#2

pawn Код:
sscanf(params,"rI(5)S(None)[50]",ID,time,reason);
If that doesen't work use;

pawn Код:
sscanf(params,"rI(5)S("None")[50]",ID,time,reason);
I think the first will do, I never worked with optional strings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)