View Single Post
Old 31/01/2020, 12:44 PM   #1
OsmanMalagic
Little Clucker
 
Join Date: Jul 2016
Location: EX-YU
Posts: 40
Reputation: 51
Default MySQL load vehicles issue

Hi guys, i have one issue with my Vehicles.
I created saving system using MySQL but my loading system not working properly.
Vehicle ID must be 1 because the car is private, and ID must go from 1 to 1000.
System loading different ID (last Car ID created on server).
I using enum CarInfo for vehicles..

PHP Code:
mysql_format(mysqlquerysizeof(query), "SELECT * FROM `vehicles`");
mysql_pquery(mysqlquery"LoadVehicles""");

forward LoadVehicles();
public 
LoadVehicles()
{
    new 
rowsfieldscountdata[24];
    
cache_get_data(rowsfields);
    for(new 
0rowsi++)
    {
        for(new 
1sizeof(CarInfo); j++)
        {
            
cache_get_field_content(i"ID"data); CarInfo[j][cID] = strval(data);
            
cache_get_field_content(i"CarID"data); CarInfo[j][cCarID] = strval(data);
            
cache_get_field_content(i"Owned"data); CarInfo[j][cOwned] = strval(data);
            
cache_get_field_content(i"Owner"data); strmid(CarInfo[j][cOwner], data0strlen(data), 64);
            
cache_get_field_content(i"Model"data); CarInfo[j][cModel] = strval(data);
            
cache_get_field_content(i"Location_X"data); CarInfo[j][cLocationx] = floatstr(data);
            
cache_get_field_content(i"Location_Y"data); CarInfo[j][cLocationy] = floatstr(data);
            
cache_get_field_content(i"Location_Z"data); CarInfo[j][cLocationz] = floatstr(data);
            
cache_get_field_content(i"Angle"data); CarInfo[j][cAngle] = floatstr(data);
            
cache_get_field_content(i"Color_1"data); CarInfo[j][cColorOne] = strval(data);
            
cache_get_field_content(i"Color_2"data); CarInfo[j][cColorTwo] = strval(data);
            
cache_get_field_content(i"VirtualWorld"data); CarInfo[j][cVirWorld] = strval(data);

            if(
CarInfo[j][cOwned] == || CarInfo[j][cModel] == 0)
            {
                
CarInfo[j][cCarID] = NBC_AddStaticVehicleEx(510, -804.53843791.850639.4313+jCarInfo[j][cAngle], CarInfo[j][cColorOne], CarInfo[j][cColorTwo], 600000);
            }
            else
            {
                
CarInfo[j][cCarID] = NBC_AddStaticVehicleEx(CarInfo[j][cModel], CarInfo[j][cLocationx], CarInfo[j][cLocationy], CarInfo[j][cLocationz]+1.0CarInfo[j][cAngle], CarInfo[j][cColorOne], CarInfo[j][cColorTwo], 600000);
            }
            
count++;
            break;
        }
    }
    return 
1;

What i do wrong?
OsmanMalagic is offline   Reply With Quote