OnGameModeInit only working to mysql_connect
#9

Quote:
Originally Posted by Antonio [G-RP]
Посмотреть сообщение
Alright haha :P

This is the beginning of the LoadCars function. The rest is unneeded to post, as it all works correctly.

pawn Код:
public LoadCars()
{
    new resultline[1024];
    new car[28][64];
    new query[256];

    printf("Loading Cars...");
    mysql_real_escape_string("SELECT VEHid,model,x,y,z,o,color1,color2,respawndelay, ownable, ownerid, factionid, jobid, engine, fuel, locked, trunkopen, hoodopen, \
    trunkinv1, trunkinv2, trunkinv3, trunkinv4, trunkinv5, trunkqnt1, trunkqnt2, trunkqnt3, trunkqnt4, trunkqnt5 FROM vehicles ORDER BY VEHid ASC"
, query);

    printf(" SQL: %s",query);
    mysql_query(query);
    mysql_store_result();

    new carid;
    while(mysql_fetch_row(resultline)==1)
    {
As posted in the starter, the connection proof.

Also, this shows that it stops loading after the first car, although I doubt it's even spawning the first car at all.

Код:
[19:42:08] Loading Cars...
[19:42:08] SQL: SELECT VEHid,model,x,y,z,o,color1,color2,respawndelay, ownable, ownerid, factionid, jobid, engine, fuel, locked, trunkopen, hoodopen, trunkinv1, trunkinv2, trunkinv3, trunkinv4, trunkinv5, trunkqnt1, trunkqnt2, trunkqnt3, trunkqnt4, trunkqnt5 FROM vehicles ORDER BY VEHid ASC
[19:42:08] 1|596|1601.45|-1683.92|5.6132|90.1938|0|1|900000|0|0|1|0|0|100|0|0|0|0|0|0|0|0|0|0|0|0|0
[19:42:08] Number of vehicle models: 0
Well i have no idea why you're escaping that string, there is NO reason to at all. You only need to do that if a user gives physical input into the query (ie in a register or login command).


Post the entire function, i dont see the problem yet and i think its somewhere inside you're loop :P.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)