mysql command out of sync
#4

You don't free the result before storing another one. I also recommend loading the cars without using a loop.

pawn Код:
stock initiateCars()
{
    new id;
    mysql_query("SELECT * FROM `cars`");
    mysql_store_result();
    while(mysql_retrieve_row())
    {
        id++;
        mysql_fetch_row_format(Query, "|")
        sscanf(Query, "p<|>e<is[24]ffffffffiis[24]s[24]is[32]s[32]iiiiiiiiiiiiiiiiiiiii>", CarInfo[id]);
        CreateVehicle(CarInfo[id][cModel], CarInfo[id][cLocationx], CarInfo[id][cLocationy], CarInfo[id][cLocationz]+1.0, CarInfo[id][cAngle], CarInfo[id][cColorOne], CarInfo[id][cColorTwo], 600000);
        gCarLock[id] = 1;
        SetVehicleNumberPlate(id, CarInfo[id][cLicense]);
        LoadComponents(id);
    }
    mysql_free_result();
}
Reply


Messages In This Thread
loading cars problem - by fordawinzz - 12.01.2012, 10:12
Re: mysql command out of sync - by [HiC]TheKiller - 12.01.2012, 10:22
Re: mysql command out of sync - by fordawinzz - 12.01.2012, 10:31
Re: mysql command out of sync - by [HiC]TheKiller - 12.01.2012, 10:39
Re: mysql command out of sync - by fordawinzz - 12.01.2012, 10:43
Re: mysql command out of sync - by [HiC]TheKiller - 12.01.2012, 10:52
Re: mysql command out of sync - by fordawinzz - 12.01.2012, 10:59
Re: mysql command out of sync - by [HiC]TheKiller - 12.01.2012, 11:04
Re: mysql command out of sync - by fordawinzz - 12.01.2012, 11:07
loading cars problem - by fordawinzz - 12.01.2012, 17:47

Forum Jump:


Users browsing this thread: 1 Guest(s)