#1

When i add cars into my MySQL they not come in game why?
Reply
#2

Show us the loading codes?
Reply
#3

http://pastebin.com/5b6S33Yy
Reply
#4

I don't see any MySQL code in that snippet of code at all. It's all just dini, are you sure that's the right code?
Reply
#5

I dont find it, i will look again tomrrow.
Reply
#6

Lmao, I'm Tottally Lost with your Post?

A: You Need Help With Vehicles, But.. You Can't Find your Coding?

Sorry, But Somthing Seems Fishy
Reply
#7

pawn Код:
forward LoadCityCars();
public LoadCityCars()
{
    mysql_query("SELECT * FROM Vehicles ORDER BY carid");
    mysql_store_result();
    new data[11][512];
    new string[1024];
    while(mysql_fetch_row(string,"|"))
    {
        if(mysql_num_rows() == 0) continue;
        split(string, data, '|');
        //printf(string);
        new Carid = CreateVehicle(strval(data[1]), floatstr(data[2]), floatstr(data[3]), floatstr(data[4]), floatstr(data[5]), strval(data[6]), strval(data[7]), 60000);
        DynamicCars[Carid][FactionCar] = strval(data[8]);
        DynamicCars[Carid][CarType] = strval(data[9]);
        strmid(DynamicCars[Carid][cDescription], data[10], 0, strlen(data[10]), 255);
        SetVehicleNumberPlate(Carid, "P:RP");
        SetVehicleToRespawn(Carid);
        if(Carid == PRCARS)
        {
            mysql_free_result();
            return 0;
        }
    }
    return 1;
}
Reply
#8

Anyone know the problem?
Reply
#9

BUMP this.
Reply
#10

First of all, remove this line:

pawn Код:
if(mysql_num_rows() == 0) continue;
The while loop will not be executed if there are no rows to fetch (mysql_fetch_row will simply return false), so counting the rows while inside the loop is pointless. Not to mention the continue statement.


About the vehicles not loading, check what the result is of the CreateVehicle function, does it return a valid vehicle id?
Print the fetched data to see what's going on.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)