An error -- deleteveh code

Started by ℛḝξ☂, Jul 08, 2015, 09:55 AM

Previous topic - Next topic

ℛḝξ☂

Here is the code
case "deleteveh":
    {
if ( player.Vehicle )
{
local v = player.Vehicle;
QuerySQL( MainDB, "DELETE FROM Cars WHERE ID='" + v.ID + "'" );
v.Delete();
MessagePlayer("Deleted vehicle successfull!y",player);
}
break;
}
// PS: The directory is right.

Then I use that, although the vehicle deleted, it'll appear when the server reloaded.
There is no error on the console.
I may be a slow walker but I am always walking.

Ankris

try to replace to:
FreeSQLQuery(QuerySQL( MainDB, "DELETE FROM Cars WHERE ID='" + v.ID + "'" ));

MatheuS

Quote from: Ankris on Jul 08, 2015, 10:48 AMtry to replace to:
FreeSQLQuery(QuerySQL( MainDB, "DELETE FROM Cars WHERE ID='" + v.ID + "'" ));

lol?
if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.

ysc3839

Quote from: Ankris on Jul 08, 2015, 10:48 AMtry to replace to:
FreeSQLQuery(QuerySQL( MainDB, "DELETE FROM Cars WHERE ID='" + v.ID + "'" ));
"DELETE" query needn't free.

MacTavish

Try

    QuerySQL( MainDB, "DELETE TABLE FROM Cars WHERE ID='" + v.ID + "'" );

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

.

That's why this thing was made people. So you can see why it fails. If the query was indeed the problem. Besides, why the quotes around a number? '32' have you ever seen numbers in quotes? I doubt that.
.

ℛḝξ☂

I may be a slow walker but I am always walking.

EK.IceFlake

Quote from: S.L.C on Jul 08, 2015, 01:52 PMThat's why this thing was made people. So you can see why it fails. If the query was indeed the problem. Besides, why the quotes around a number? '32' have you ever seen numbers in quotes? I doubt that.
WHY DID YOU ANSWER BEFORE ME??? I was the one noticing that and was just about to give out the reason but I saw that you already told him :(