21.02.2014, 16:16
Quote:
I don't really understand what you want to do and what the code you've posted is supposed to do. Some parts are half, I'll show you:
You format a query with INSERT INTO clause but you never execute a query. So what's the point of doing it if you don't want to insert a new row? What's the point of the loop, the convertion of integer to string when you can use %i or %d specifier and the maxHit? Last one, the callback. Your arguments are 2 in the callback: vehicleid, playerid but you only pass 1 argument in the callback in mysql_tquery. |
The loop is checking each row of the `vehicles` table for an invalid model (empty row) where it might insert a new vehicle rather than constantly auto incrementing (this way if the /dveh command is executed, it can delete the noted row -- without it however when using DestroyVehicle(id) -- it uses a server id, not the table id.).. IN THEORY.
The second argument on the callback was a test (playerid) to relay a message back to the sender... It's not needed.
The hitMax was the only way I could think of to say to break the loop since it's using an if statement OUTSIDE of the loop (custom function)