need help with sscanf - 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: need help with sscanf (
/showthread.php?tid=396624)
need help with sscanf -
scriptit - 01.12.2012
Hello.
I am new to sscanf.
I am trying to unpack data from | delimited text.
Код:
new id,money,password[30],name[30];
sscanf("1|rain|mypass|12003400", "i|s|s|i",id,name, password, money);
new result2[255];
format(result2,sizeof(result2),"id: %d name: %s pass: %s money:%d",id,name,password,money);
print(result2);
it outputs:
id: 0 name: pass: money:0
How could I fix it?
Re: need help with sscanf -
SuperViper - 01.12.2012
pawn Код:
sscanf("1|rain|mypass|12003400", "p<|>is[24]s[30]i", id, name, password, money);
Re: need help with sscanf -
scriptit - 01.12.2012
thank you very much.