What use is "quiet"? - sscanf
#6

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
pawn Код:
// Let's say we have a file that contains
// HouseInt, HousePrice, HouseOutsideX, HouseOutsideY, HouseOutsideZ

// The string looks like this when we get it back; "0|50000|23.0000|123.0000|1.0000"

// We can use the quiet function of sscanf to only get what we currently want (for whatever reason)
new Float:X,Float:Y,Float:Z;
sscanf(file_string, "p<|>{i}{i}fff", X,Y,Z);

// Now our X Y Z variables will be set to the proper values.
// Let's say we wanted to load the pickups or CPs for entering the house
// in a different function than where we set the textlabels data.
// That would be one use of this function
It's good if you want to load separate things at separate times even though they're contained in the same file.
This would not be the same as my code ?:

pawn Код:
new var,var2;
    sscanf("20 30 50", "ii", var,var2);
    printf("%i %i", var,var2);
Reply


Messages In This Thread
What use is "quiet"? - sscanf - by GranaT3 - 01.11.2015, 01:05
Re: Respuesta: Re: What use is "quiet"? - sscanf - by Kevln - 01.11.2015, 01:07
Re: What use is "quiet"? - sscanf - by Kevln - 01.11.2015, 01:19
Re: What use is "quiet"? - sscanf - by [ABK]Antonio - 01.11.2015, 01:27
Respuesta: Re: What use is "quiet"? - sscanf - by GranaT3 - 01.11.2015, 01:39
Respuesta: Re: What use is "quiet"? - sscanf - by GranaT3 - 02.11.2015, 00:03
Re: What use is "quiet"? - sscanf - by Jefff - 02.11.2015, 00:08
Respuesta: Re: What use is "quiet"? - sscanf - by GranaT3 - 02.11.2015, 00:20
Re: What use is "quiet"? - sscanf - by Kevln - 02.11.2015, 00:47
Respuesta: Re: What use is "quiet"? - sscanf - by GranaT3 - 02.11.2015, 00:58

Forum Jump:


Users browsing this thread: 2 Guest(s)