MySQL string to variable
#16

Dayum, posted the wrong one; my bad
Код:
[20:32:24] ProcessQueryThread(OnVehicleLoad) - Executing query SELECT * FROM vehicles WHERE carid = 1...
[20:32:24] ProcessQueryThread(OnVehicleLoad) - Query was successful.
[20:32:24] ProcessQueryThread(OnVehicleLoad) - Data caching enabled.
[20:32:24] CMySQLHandler::StoreResult() - Result was stored.
[20:32:24] CMySQLHandler::FreeResult() - Result was successfully freed.
[20:32:24] ProcessQueryThread(OnVehicleLoad) - Data being passed to ProcessTick().
[20:32:24] OnVehicleLoad(i) - Callback is being called...
[20:32:24] >> cache_get_data(Connection handle: 1)
[20:32:24] ProcessTick() - The cache has been cleared.
This is the one to load a vehicle.
pawn Код:
forward OnVehicleLoad( vehicleID );
public OnVehicleLoad( vehicleID )
{
    new rows, fields;
    cache_get_data( rows, fields, g_Handle );
    if( rows )
    {
        //new fetch[24];
        VehicleInfo[vehicleID][vModel]              = cache_get_row_int( 0, 2, g_Handle );
        VehicleInfo[vehicleID][vLoc][0]             = cache_get_row_float( 0, 3, g_Handle );
        VehicleInfo[vehicleID][vLoc][1]             = cache_get_row_float( 0, 4, g_Handle );
        VehicleInfo[vehicleID][vLoc][2]             = cache_get_row_float( 0, 5, g_Handle );
        VehicleInfo[vehicleID][vLoc][3]             = cache_get_row_float( 0, 6, g_Handle );
        VehicleInfo[vehicleID][vColor1]             = cache_get_row_int( 0, 7, g_Handle );
        VehicleInfo[vehicleID][vColor2]             = cache_get_row_int( 0, 8, g_Handle );
        cache_get_row( 0, 1, VehicleInfo[vehicleID][vOwner], g_Handle );
       
        VehicleInfo[vehicleID][vLocked]             = cache_get_row_int( 0, 9, g_Handle );
        VehicleInfo[vehicleID][vID] = CreatePersVehicle( VehicleInfo[vehicleID][vModel],
                                                         VehicleInfo[vehicleID][vLoc][0], VehicleInfo[vehicleID][vLoc][1], VehicleInfo[vehicleID][vLoc][2], VehicleInfo[vehicleID][vLoc][3],
                                                         VehicleInfo[vehicleID][vColor1], VehicleInfo[vehicleID][vColor2], VehicleInfo[vehicleID][vOwner], VehicleInfo[vehicleID][vLocked], false );

        printf( "Vehicle from %s has been loaded. (ID: %i)", VehicleInfo[vehicleID][vOwner], vehicleID );
    }
    return 1;
}
Whenever i create a new vehicle in game, all of the data gets succesfully saved. Including the username, which in my case will be 'Wesley'. Whenever i try to load every vehicles, everything loads except the vOwner.
Reply


Messages In This Thread
MySQL string to variable - by Wesley221 - 29.04.2013, 18:17
Re: MySQL string to variable - by MP2 - 30.04.2013, 08:33
Re: MySQL string to variable - by AndreT - 30.04.2013, 08:51
Re: MySQL string to variable - by MP2 - 30.04.2013, 08:53
Re: MySQL string to variable - by AndreT - 30.04.2013, 10:19
Re: MySQL string to variable - by MP2 - 30.04.2013, 10:42
Re: MySQL string to variable - by AndreT - 30.04.2013, 12:30
Re: MySQL string to variable - by MP2 - 30.04.2013, 12:37
Re: MySQL string to variable - by Wesley221 - 30.04.2013, 13:48
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 15:24
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:07
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 18:13
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:19
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 18:24
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:28
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 18:35
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:48
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 19:37
Re: MySQL string to variable - by Wesley221 - 03.05.2013, 17:43
Re: MySQL string to variable - by Scenario - 03.05.2013, 17:51
Re: MySQL string to variable - by Wesley221 - 03.05.2013, 19:32
Re: MySQL string to variable - by InfiniTy. - 03.05.2013, 19:41
Re: MySQL string to variable - by Wesley221 - 03.05.2013, 20:32
Re: MySQL string to variable - by InfiniTy. - 03.05.2013, 20:51
Re: MySQL string to variable - by Wesley221 - 04.05.2013, 13:54
Re: MySQL string to variable - by InfiniTy. - 04.05.2013, 14:39
Re: MySQL string to variable - by Wesley221 - 04.05.2013, 15:13
Re: MySQL string to variable - by Wesley221 - 05.05.2013, 14:16

Forum Jump:


Users browsing this thread: 2 Guest(s)