02.09.2012, 21:22
Hello
I have this TEXT var inside my database: 2315.5898x34.4094x27.4740x873.8801x-16.1444x63.1953x2351.6484x-651.8053x128.0547
Those are coords which I will split after I have loaded them.
But at the load function, it doesn't load the string correctly. It loads all other variables inside the table except this one.
Here I show you my load function.
I have already checked everything for misspellings.
I have this TEXT var inside my database: 2315.5898x34.4094x27.4740x873.8801x-16.1444x63.1953x2351.6484x-651.8053x128.0547
Those are coords which I will split after I have loaded them.
But at the load function, it doesn't load the string correctly. It loads all other variables inside the table except this one.
Here I show you my load function.
pawn Code:
public LoadJobs()
{
new id,pickupid;
while (id < sizeof(j))
{
printf("%d",id);
format(JobQuery, sizeof(JobQuery), "SELECT * FROM `jobs` WHERE `ID` = %d", id);
mysql_query(JobQuery);
mysql_store_result();
if(mysql_num_rows())
{
mysql_fetch_row_format(JobQuery, "|");
sscanf(JobQuery, "p<|>is[256]s[256]s[512]i",
id,
j[id][JOB_Name],
j[id][JOB_INT],
j[id][JOB_FLOAT],
j[id][JOB_Contract]);
mysql_free_result();
print(j[id][JOB_FLOAT]); // Prints out: 0
print(j[id][JOB_Name]); // Prints the correct name.
sscanf(j[id][JOB_INT], "p<x>a<d>[20]", j[id][JOB_INT_DATA]);
sscanf(j[id][JOB_FLOAT], "p<x>a<f>[24]", j[id][JOB_FLOAT_DATA]);
printf("%f",j[0][JOB_FLOAT_DATA][0]); // Prints 0.000000
if(id == drugs)
{
if(j[id][JOB_FLOAT_DATA][0] != 0)
{
pickupid = CreateDynamicPickup(1313,23,j[id][JOB_FLOAT_DATA][0],j[id][JOB_FLOAT_DATA][1],j[id][JOB_FLOAT_DATA][2],-1,-1,-1,50.0);
PickupType[pickupid] = JOB_TYPE;
Create3DTextLabel("Drugs Point [/pickup]",White,j[id][JOB_FLOAT_DATA][0],j[id][JOB_FLOAT_DATA][1],j[id][JOB_FLOAT_DATA][2],15.0,0);
pickupid = CreateDynamicPickup(1313,23,j[id][JOB_FLOAT_DATA][3],j[id][JOB_FLOAT_DATA][4],j[id][JOB_FLOAT_DATA][5],-1,-1,-1,50.0);
PickupType[pickupid] = JOB_TYPE;
Create3DTextLabel("Drugs Point [/pickup]",White,j[id][JOB_FLOAT_DATA][3],j[id][JOB_FLOAT_DATA][4],j[id][JOB_FLOAT_DATA][5],15.0,0);
pickupid = CreateDynamicPickup(1313,23,j[id][JOB_FLOAT_DATA][6],j[id][JOB_FLOAT_DATA][7],j[id][JOB_FLOAT_DATA][8],-1,-1,-1,50.0);
PickupType[pickupid] = JOB_TYPE;
Create3DTextLabel("Drugs Point [/pickup]",White,j[id][JOB_FLOAT_DATA][6],j[id][JOB_FLOAT_DATA][7],j[id][JOB_FLOAT_DATA][8],15.0,0);
}
}
if(id == arms)
{
if(j[id][JOB_FLOAT_DATA][0] != 0)
{
pickupid = CreateDynamicPickup(1431,23,j[id][JOB_FLOAT_DATA][0],j[id][JOB_FLOAT_DATA][1],j[id][JOB_FLOAT_DATA][2],-1,-1,-1,50.0); // A (p)
PickupType[pickupid] = JOB_TYPE;
Create3DTextLabel("A Packages [/pickup]",White,j[id][JOB_FLOAT_DATA][0],j[id][JOB_FLOAT_DATA][1],j[id][JOB_FLOAT_DATA][2],15.0,0);
pickupid = CreateDynamicPickup(1271,23,j[id][JOB_FLOAT_DATA][3],j[id][JOB_FLOAT_DATA][4],j[id][JOB_FLOAT_DATA][5],-1,-1,-1,50.0); // A (d)
PickupType[pickupid] = JOB_TYPE;
Create3DTextLabel("A Materials [/deliver]",White,j[id][JOB_FLOAT_DATA][3],j[id][JOB_FLOAT_DATA][4],j[id][JOB_FLOAT_DATA][5],15.0,0);
pickupid = CreateDynamicPickup(1431,23,j[id][JOB_FLOAT_DATA][6],j[id][JOB_FLOAT_DATA][7],j[id][JOB_FLOAT_DATA][8],-1,-1,-1,50.0); // B (p)
PickupType[pickupid] = JOB_TYPE;
Create3DTextLabel("B Packages [/pickup]",White,j[id][JOB_FLOAT_DATA][6],j[id][JOB_FLOAT_DATA][7],j[id][JOB_FLOAT_DATA][8],15.0,0);
pickupid = CreateDynamicPickup(1271,23,j[id][JOB_FLOAT_DATA][9],j[id][JOB_FLOAT_DATA][10],j[id][JOB_FLOAT_DATA][11],-1,-1,-1,50.0); // B (d)
PickupType[pickupid] = JOB_TYPE;
Create3DTextLabel("B Materials [/deliver]",White,j[id][JOB_FLOAT_DATA][9],j[id][JOB_FLOAT_DATA][10],j[id][JOB_FLOAT_DATA][11],15.0,0);
pickupid = CreateDynamicPickup(1431,23,j[id][JOB_FLOAT_DATA][12],j[id][JOB_FLOAT_DATA][13],j[id][JOB_FLOAT_DATA][14],-1,-1,-1,50.0); // C (p)
PickupType[pickupid] = JOB_TYPE;
Create3DTextLabel("C Packages [/pickup]",White,j[id][JOB_FLOAT_DATA][12],j[id][JOB_FLOAT_DATA][13],j[id][JOB_FLOAT_DATA][14],15.0,0);
pickupid = CreateDynamicPickup(1271,23,j[id][JOB_FLOAT_DATA][15],j[id][JOB_FLOAT_DATA][16],j[id][JOB_FLOAT_DATA][17],-1,-1,-1,50.0); // C (d)
PickupType[pickupid] = JOB_TYPE;
Create3DTextLabel("C Materials [/deliver]",White,j[id][JOB_FLOAT_DATA][15],j[id][JOB_FLOAT_DATA][16],j[id][JOB_FLOAT_DATA][17],15.0,0);
pickupid = CreateDynamicPickup(1431,23,j[id][JOB_FLOAT_DATA][18],j[id][JOB_FLOAT_DATA][19],j[id][JOB_FLOAT_DATA][20],-1,-1,-1,50.0); // D (p)
PickupType[pickupid] = JOB_TYPE;
Create3DTextLabel("D Packages [/pickup]",White,j[id][JOB_FLOAT_DATA][18],j[id][JOB_FLOAT_DATA][19],j[id][JOB_FLOAT_DATA][20],15.0,0);
pickupid = CreateDynamicPickup(1271,23,j[id][JOB_FLOAT_DATA][21],j[id][JOB_FLOAT_DATA][22],j[id][JOB_FLOAT_DATA][23],-1,-1,-1,50.0); // D (d)
PickupType[pickupid] = JOB_TYPE;
Create3DTextLabel("D Materials [/deliver]",White,j[id][JOB_FLOAT_DATA][21],j[id][JOB_FLOAT_DATA][22],j[id][JOB_FLOAT_DATA][23],15.0,0);
}
}
}
id++;
}
return 1;
}