SA-MP Forums Archive
Something is up with this code. [+REP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Something is up with this code. [+REP] (/showthread.php?tid=430741)



Something is up with this code. [+REP] - EliteApple - 15.04.2013

NEW;
When I /editcar park, some of my vehicles models change. And they're not suppose too. It's gotta do something with this;
pawn Код:
format(query, sizeof(query), "SELECT * FROM Vehicles WHERE carid=%d", vehicle);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row(row);
    split(row, arrCoords, '|');
    DestroyVehicle(vehicle);
    new Carid = CreateVehicle(strval(arrCoords[1]), floatstr(arrCoords[2]), floatstr(arrCoords[3]), floatstr(arrCoords[4]), floatstr(arrCoords[5]), strval(arrCoords[6]), strval(arrCoords[7]), 60000);
I'm new to MySQLl so I'm not sure if I'm doing things right.

I'm trying to get the vehicle's information by using its ingame ID, and sometimes it gives me wrong stuff. Ideas?


Re: Something is up with this code. [+REP] - Jefff - 15.04.2013

https://sampwiki.blast.hk/wiki/Strval


Re: Something is up with this code. [+REP] - EliteApple - 15.04.2013

It's kinda late, and I have no clue what I'm doing at the moment, can you please explain more? I apologize.


Re: Something is up with this code. [+REP] - EliteApple - 15.04.2013

Nevermind, I looked at another part of my code, thanks.


Re: Something is up with this code. [+REP] - EliteApple - 15.04.2013

NEW;
When I /editcar park, some of my vehicles models change. And they're not suppose too. It's gotta do something with this;
pawn Код:
format(query, sizeof(query), "SELECT * FROM Vehicles WHERE carid=%d", vehicle);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row(row);
    split(row, arrCoords, '|');
    DestroyVehicle(vehicle);
    new Carid = CreateVehicle(strval(arrCoords[1]), floatstr(arrCoords[2]), floatstr(arrCoords[3]), floatstr(arrCoords[4]), floatstr(arrCoords[5]), strval(arrCoords[6]), strval(arrCoords[7]), 60000);
I'm new to MySQLl so I'm not sure if I'm doing things right.

I'm trying to get the vehicle's information by using its ingame ID, and sometimes it gives me wrong stuff. Ideas?