MySQL Car System no saving.
#1

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
Reply
#2

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
Reply
#3

My Player Accounts load, so it has to be connecting.
Otherwise, they wouldn't load either as their connected from the same database.
Reply
#4

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
Reply
#5

And use this SaveVehicle stock
pawn Code:
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
Reply
#6

So, did you fixed it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)