SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MYSQL - Load vehicles. DarkLouis Scripting Help 2 09/06/2015 08:27 AM
MySQL Load Issue RedCounty Scripting Help 4 14/01/2015 09:03 PM
How to load and save vehicles from MySQL R38? TheNerka Scripting Help 21 12/09/2014 02:32 PM
Load Vehicles + MYSQL Stefand Scripting Help 2 04/06/2013 02:44 PM
MySQL: Vehicles don't load... Tee Help Archive 0 08/08/2011 09:13 AM


All times are GMT. The time now is 01:38 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.