PDA

View Full Version : MySQL Car System no saving.


Lynn
18/01/2015, 09:42 PM
So I'm still trying to create a SQL Car system, and it's just not saving to the Database.
It has to be connecting to the database because my player accounts load fine.
However, for some reason my vehicle system refuses to work.
It creates the vehicle in-game using the command, but doesn't save it after words.
I turned the server off to call OnGameModeExit and it didn't save then either.

Code:
http://pastebin.com/B3Er3J6H

MySQL Log:
http://pastebin.com/qfmb6w4k

CoaPsyFactor
18/01/2015, 11:27 PM
as you can see, you have invalid connection handle error, it looks like you are trying to run query on non existing connection. Show us you mysql_connect

Lynn
19/01/2015, 12:30 AM
My Player Accounts load, so it has to be connecting.
Otherwise, they wouldn't load either as their connected from the same database.

CoaPsyFactor
19/01/2015, 02:02 AM
well problem is in enum, you have MainPipeline defined in there, so it override you variable that holds mysql connection id - as I don't see mysql_connect in this part of code :)

BroZeus
19/01/2015, 07:15 AM
And use this SaveVehicle stock

SaveVehicles()
{
for(new v = 0; v < MAX_VEHICLES; v++)if(IsValidVehicle(v)) SaveVehicle(v);
}
You forgot to write IsValidVehicle(v)
If u don't do this then it will save 2000 vehicles in database with coords 0.0 0.0 0.0 and thus will load 2000 vehicles at those coords
And if there is any other command for creating vehicle or you create vehicle with AddStaticVehicle OnGameModeInit OR if u create vehicle using a FS then this system will bug, this system is only valid if u create cars using createveh command

CoaPsyFactor
19/01/2015, 08:28 AM
So, did you fixed it?