Mysql r35 help!
#1

Hello guys , i want to ask a question about MySQL R35 or lower versions (r7+), i have vehicle system on r6 and older i need to convert that to r35
pawn Код:
stock LoadVehicles()
{
    new Query[255], id;
    format(Query, sizeof(Query), "SELECT * FROM vehicles");
    mysql_query(Query);
    mysql_store_result();
    while(mysql_fetch_row(Query,"|"))
    {
        id = LoadedInfo[Vehicles];
        sscanf(Query, "p<|>e<is[25]iiffff>", VehicleInfo[id]);
        new Color1 = random(126); new Color2 = random(126);
        CreateVehicle(VehicleInfo[id][Model],VehicleInfo[id][Pos][X],VehicleInfo[id][Pos][Y],VehicleInfo[id][Pos][Z],VehicleInfo[id][Pos][R],Color1,Color2, 60*10000);
        LoadedInfo[Vehicles] = LoadedInfo[Vehicles] + 1;
    }
}
What is the functions of mysql r35 ( instead of mysql_fetch_row , mysql_store_result)..
Thanks!

And here is my vehicle enum (if needed)
pawn Код:
enum vInfo
{
     Id,
     Owner[25],
     Model,
     Price,
     Float:cx,
     Float:cy,
     Float:cz,
     Float:cr
}
new VehicleInfo[MAX_VEHICLES][vInfo];
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=337810
Reply
#3

If you don't know don't post please , i saw that tutorial and i can't convert that's why i came here asking for help not for links..
Reply
#4

Check the wiki for the latest natives and their examples: https://sampwiki.blast.hk/wiki/MySQL/R33 (This is updated for R35 recently by maddinat0r)

pawn Код:
// This is just an example.
stock LoadVehicles()
{
    // Edit the 1 to your connection handle.
    mysql_tquery(1, "SELECT * FROM vehicles", "LoadVehicleMySQL");
}

forward public LoadVehicleMySQL;
public LoadVehicleMySQL()
{
    for(new yy=0; yy < cache_get_row_count(); ++yy)
    {
        cache_get_row(yy, 0, VehicleInfo[id][Model]);
        cache_get_row_float(yy, 1, VehicleInfo[id][Pos][X]);
        cache_get_row_float(yy, 2, VehicleInfo[id][Pos][Y]);
        // This isn't completed yet, now do the rest.
    }
    return true;
}
Reply
#5

Thank you so much iZN!
Reply
#6

Still not working anyways thanks IZN , any more help guys?
Reply
#7

sir , he just gave you an example , you need to modify the code to fit your needs and you cannot do that without understanding the tutorial.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)