sscanf read - 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 read (
/showthread.php?tid=175090)
sscanf read -
vection - 08.09.2010
i'm using sscanf to read from mysql.
and i have this code:
pawn Код:
new
var[pInfo];
sscanf(line, "p|ssddddddddddddsddddddddddddddddddddddddddddddddddddddffdddddddddddddddddddddddddddddddddddddddddsssssdffffdffffdffffddffffffffdfffffffffffffffdddsssssffffdddddddddddddddddddddddddddddddddddddddddddddddddds", data[0], var); //Splits the line with sscanf
i want to set it to pInfo.
THe problem is if i use sscanf2 include i cant run the server, FIle or function is not found.
But i think its not the problem, i just need a way to load all fields to pInfo enum.
This way, is not working at all.
Re: sscanf read -
Retardedwolf - 08.09.2010
You need the plugin + the include.
Edit server.cfg
Add a plugins line if its not there and add it to the server.cfg like this.
and include it in your gamemode.
(This is about the sscanf2 not working)
Re: sscanf read -
HadFuny - 08.09.2010
You can't store to a enum because you need the enum secifier and sizes on the strings.
EDIT: User ****** method.
Re: sscanf read -
vection - 08.09.2010
i edit that for somthing like this:
pawn Код:
new
var[pInfo];
sscanf(line, "p<|>e<s[24]s[30]dddddddddddds[30]ddddddddddddddddddddddddddddddddddddddffddddddddddddddddddddddddddddddddddddddddds[30]s[30]s[30]s[30]s[30]dffffdffffdffffddffffffffdfffffffffffffffddds[30]s[30]s[30]s[30]s[30]ffffdddddddddddddddddddddddddddddddddddddddddddddddddds[30]>", data[0], var); //Splits the line with sscanf
i added sizes for "s" .. still doesnt work.
* added the plugin.
Re: sscanf read -
vection - 08.09.2010
pawn Код:
pInfo:
enum pInfo
{
pKey[128],
pLevel,
pAdmin,
pDonateRank,
gPupgrade,
pConnectTime,
pReg,
pSex,
pAge,
pBan,
pReason,
pOrigin,
pCK,
[Continue here..]
};
new PlayerInfo[MAX_PLAYERS][pInfo];
Line code:
new line[750];
if(mysql_fetch_row(line)) //Fetches the line
{
}
Re: sscanf read -
vection - 08.09.2010
Bump.. :/
Re: sscanf read -
vection - 09.09.2010
PLEASEEE NEED THAT !@