find next 6 numbers - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: find next 6 numbers (
/showthread.php?tid=405657)
find next 6 numbers -
[D]ry[D]esert - 07.01.2013
Hello everyone, i am trying to make converter using pawno, not object converter.
and i wanna string find text then i wanna save the value of the next 7 numbers after the text, for example:
pawn Код:
if(strfind("Pos=1000.000","Pos",true) != -1 )
{
format(string[2],sizeof string[2],"%0.5f",TheNext9LettersAfterPos=);
}
Is that possible ?
like i wanna replace pos=1000.000 with 1000.000.
Thanks for reading
Re: find next 6 numbers -
JM_Millers - 07.01.2013
%0.5f ??
Re: find next 6 numbers -
[D]ry[D]esert - 07.01.2013
Quote:
Originally Posted by JM_Millers
%0.5f ??
|
ya, i wanna save the float on that string.
Re: find next 6 numbers -
[D]ry[D]esert - 07.01.2013
Quote:
Originally Posted by ******
This is the sort of thing that sscanf is for:
"'Pos='a<f>[5]"
|
I am using sscanf that will be good,but Can you give example please ?
Re: find next 6 numbers -
[D]ry[D]esert - 08.01.2013
Quote:
Originally Posted by ******
What was wrong with the example I already gave?
|
I mean should it be like that ? and what is 'a' in 'PosZ='a<f>[5]?
pawn Код:
if(!sscanf(string,"'PosZ='a<f>[5]",zPosStr) && !sscanf(str0,"'PosX='a<f>[5]",xPosStr))
Re: find next 6 numbers -
[D]ry[D]esert - 08.01.2013
Quote:
Originally Posted by ******
The various specifiers are all well documented in the sscanf topic.
|
Aha, okey thanks.
One more question,
pawn Код:
!sscanf(string,"'PosZ='a<f>[5]",zPosStr)
This will save the float in the variable ? if no then how to save that float in a variable?