Please explain.
#1

So, finally I thought I would learn zcmd and sscanf and give up the old strcmp..

I started looking on wiki for sscanf and I found this.

Код:
Function:
	sscanf
Params:
	string[] - String to extract parameters from.
	format[] - Parameter types to get.
	{Float,_}:... - Data return variables.
Return:
	0 - Successful, not 0 - fail.
Notes:
	A fail is either insufficient variables to store the data or insufficient
	data for the format string - excess data is disgarded.
 
	A string in the middle of the input data is extracted as a single word, a
	string at the end of the data collects all remaining text.
 
	The format codes are:
 
	c - A character.
	d, i - An integer.
	h, x - A hex number (e.g. a colour).
	f - A float.
	s - A string.
	z - An optional string.
	pX - An additional delimiter where X is another character.
	'' - Encloses a litteral string to locate.
	u - User, takes a name, part of a name or an id and returns the id if they're connected.
 
	Now has IsNumeric integrated into the code.
 
	Added additional delimiters in the form of all whitespace and an
	optioanlly specified one in the format string.
But I got stuck on these two lines:
Код:
	s - A string.
	z - An optional string.
What is the differance between a string and an optional string?
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
Read the first post of the plugin's topic - there are far more detailed explanations there. Also, welcome to 5 years ago!
Thanks!

The thread was made 2010 so I'm only 4 years late! Haha
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)