[HELP]sscanf console error
#1

I se this code for my server..

Код:
LoadData(playerid)
{
  new
    pName[24],
    query[61],
    line[100];

  GetPlayerName(playerid, pName, 24);
  mysql_real_escape_string(pName, pName);
  format(query, sizeof(query), "SELECT * FROM jugadores WHERE nombre='%s'", pName); // we check and get the gata from that name
  mysql_query(query);
  mysql_store_result(); // we store the result.
  mysql_fetch_row_format(line, "."); // we set a delimiter
  sscanf(line, "p.issiii", pinfo[playerid][id], pinfo[playerid][nombre], pinfo[playerid][pass], pinfo[playerid][dinero], pinfo[playerid][trabajo], pinfo[playerid][admin]); // this will get the first 3 fields into pinfo[playerid][playeri]
  mysql_free_result();
  new textto[128];
  SendClientMessage(playerid, COLOR_LIGHTBLUE, textto);
  return 1;
}
When i am in the servers.. works perfectly the code but i dont know this error... apperas in my server console.. i dont understand it



Any help?

Reply
#2

I fix the p<.> error but i dont fix the otherr
Reply
#3

I need to fix that error the warning pls help here is the line

Код:
sscanf(line, "p<.>issiii", pinfo[playerid][id], pinfo[playerid][nombre], pinfo[playerid][pass], pinfo[playerid][dinero], pinfo[playerid][trabajo], pinfo[playerid][admin]); // this will get the first 3 fields into pinfo[playerid][playeri][/code{
Reply
#4

You must specify the string's size. http://forum.sa-mp.com/index.php?topic=145539.0 read the "Strings" section
Reply
#5

Thx for help but i dont know where put the size?.. i need tu usea sizeof
Reply
#6

The size of the string goes right behind the specifier.
Example:
pawn Код:
new str[20];
sscanf("hello there", "s[20]", str);
Reply
#7

Quote:
Originally Posted by bogeyman_EST
The size of the string goes right behind the specifier.
Example:
pawn Код:
new str[20];
sscanf("hello there", "s[20]", str);
dont understand in this line where i need to put the size

sscanf(line, "p<.>issiiiiiiiifffiii", pinfo[playerid][id], pinfo[playerid][nombre], pinfo[playerid][pass], pinfo[playerid][nivel], pinfo[playerid][dinero], pinfo[playerid][trabajo], pinfo[playerid][admin], pinfo[playerid][online], pinfo[playerid][phone], pinfo[playerid][banco], pinfo[playerid][skin], pinfo[playerid][px], pinfo[playerid][py], pinfo[playerid][pz], pinfo[playerid][hp], pinfo[playerid][armor], pinfo[playerid][sp]);
Reply
#8

pawn Код:
sscanf(line, "p<.>is[/*insert size of pinfo[playerid][nombre] here */]s[/*insert size of pinfo[playerid][pass] here*/]iiiiiiiifffiii", pinfo[playerid][id], pinfo[playerid][nombre], pinfo[playerid][pass], pinfo[playerid][nivel], pinfo[playerid][dinero], pinfo[playerid][trabajo], pinfo[playerid][admin], pinfo[playerid][online], pinfo[playerid][phone], pinfo[playerid][banco], pinfo[playerid][skin], pinfo[playerid][px], pinfo[playerid][py], pinfo[playerid][pz], pinfo[playerid][hp], pinfo[playerid][armor], pinfo[playerid][sp]);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)