SA-MP Forums Archive
sscanf help please! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: sscanf help please! (/showthread.php?tid=114263)



sscanf help please! - SiJ - 18.12.2009

Never mind.. I'll try to figure it out myself... somehow.....


Re: [Easy] dini help please! - dice7 - 18.12.2009

Get a string tokemizer/manipulator/whatever (i suggest sscanf), a do something like this
pawn Код:
new Gangs[4][256]
sscanf(dini_Get(Gangs.info,"Gangs"), "ssss", Gangs[0], Gangs[1], Gangs[2], Gangs[3]);
In this case strtok may actually be better, since you can loop it


Re: [Easy] dini help please! - SiJ - 18.12.2009

Quote:
Originally Posted by dice7
Get a string tokemizer/manipulator/whatever (i suggest sscanf), a do something like this
pawn Код:
new Gangs[4][256]
sscanf(dini_Get(Gangs.info,"Gangs"), "ssss", Gangs[0], Gangs[1], Gangs[2], Gangs[3]);
In this case strtok may actually be better, since you can loop it
Thanks, I'll try it


Re: [Easy] dini help please! - SiJ - 18.12.2009

I cannot get it to work...
You made some errors in code, I've fixed them but I get these errors:
.inc(31) : error 001: expected token: ")", but found "("
.inc(31) : warning 215: expression has no effect

pawn Код:
new Gangs[4][256];
sscanf(dini_Get("Gangs.info","Gangs"), "ssss", Gangs[0], Gangs[1], Gangs[2], Gangs[3]);



Re: [Easy] dini help please! - Zamaroht - 18.12.2009

It's missing a closing )

pawn Код:
new Gangs[4][256];
scanf(dini_Get("Gangs.info","Gangs"), "ssss", Gangs[0], Gangs[1], Gangs[2], Gangs[3]));



Re: [Easy] dini help please! - SiJ - 18.12.2009

Quote:
Originally Posted by Zamaroht
It's missing a closing )


new Gangs[4][256];
scanf(dini_Get("Gangs.info","Gangs"), "ssss", Gangs[0], Gangs[1], Gangs[2], Gangs[3]));
No it doesn't.. :P


Re: [*UNSOLVED*] sscanf help please! - Zamaroht - 18.12.2009

Woops my bad, ignore me.


Re: [*UNSOLVED*] sscanf help please! - Joe Staff - 18.12.2009

Then there's an error in one of your includes
Quote:
Originally Posted by SiJ
You made some errors in code, I've fixed them but I get these errors:
.inc(31) : error 001: expected token: ")", but found "("
.inc(31) : warning 215: expression has no effect



Re: [*UNSOLVED*] sscanf help please! - SiJ - 18.12.2009

Quote:
Originally Posted by Joe Staff
Then there's an error in one of your includes
Quote:
Originally Posted by SiJ
You made some errors in code, I've fixed them but I get these errors:
.inc(31) : error 001: expected token: ")", but found "("
.inc(31) : warning 215: expression has no effect
That's because my sscanf code is in include..


Re: *UNSOLVED!* sscanf help please! - SiJ - 19.12.2009

up to the sky!