A problem with sccanf (i think ) - 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: A problem with sccanf (i think ) (
/showthread.php?tid=435296)
A problem with sccanf (i think ) [Solved] -
Dj_maryo1993 - 06.05.2013
Ok so i got this function :
pawn Код:
public LoadPickup(sqlid)
{
new query[128];
new wholehouse[256];
format(query, sizeof(query), "SELECT * FROM `pickups` WHERE `id` = '%d'", sqlid);
mysql_query(query);
mysql_store_result();
mysql_fetch_row(wholehouse);
printf("pass1");
sscanf(wholehouse, "p<|>iiifffs[64]",PickupInfo[ploadet][id],PickupInfo[ploadet][modell],PickupInfo[ploadet][tip],PickupInfo[ploadet][Cx],PickupInfo[ploadet][Cy],PickupInfo[ploadet][Cz],PickupInfo[ploadet][texxt]);
printf("pass2");
CreatePickup(PickupInfo[ploadet][modell],PickupInfo[ploadet][tip],PickupInfo[ploadet][Cx],PickupInfo[ploadet][Cy],PickupInfo[ploadet][Cz],-1);
printf("pass3");
Create3DTextLabel(PickupInfo[ploadet][texxt], 0xFFFF00AA,PickupInfo[ploadet][Cx],PickupInfo[ploadet][Cy],PickupInfo[ploadet][Cz] , 30.0, sqlid, 0);
ploadet++;
mysql_free_result();
printf("pass4");
return 1;
}
Wich load something frome the DB
I call it like this
pawn Код:
/* Cars /factiones /houses/bizz and much more loadet the same way above,all works corectly*/
mysql_query("SELECT NULL FROM `pickups`");
mysql_store_result();
picktot = mysql_num_rows();
mysql_free_result();
printf("There are %d pickups",picktot);
for(new i = 1; i < picktot+1; i++)
{
LoadPickup(i);
}
printf("ALL STATIC LOADET FROM MYSQL");
return 1;
The problem is with the "sscanf" line ,because i get the "pass1" print , but "pass2" or further are not shown.
Here is The DB

.
Also , the query returns correct info
Код:
Function: mysql_fetch_row executed with result: "1|1239|23|361.939|173.726|1008.38|/jobs"
Any thots on what's wrong here ?
LE : Solved