Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: ℛḝξ☂ on Jul 08, 2015, 09:55 AM

Title: An error -- deleteveh code
Post by: ℛḝξ☂ on Jul 08, 2015, 09:55 AM
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.
Title: Re: An error -- deleteveh code
Post by: Ankris on Jul 08, 2015, 10:48 AM
try to replace to:
FreeSQLQuery(QuerySQL( MainDB, "DELETE FROM Cars WHERE ID='" + v.ID + "'" ));
Title: Re: An error -- deleteveh code
Post by: MatheuS on Jul 08, 2015, 12:46 PM
Quote from: Ankris on Jul 08, 2015, 10:48 AMtry to replace to:
FreeSQLQuery(QuerySQL( MainDB, "DELETE FROM Cars WHERE ID='" + v.ID + "'" ));

lol?
Title: Re: An error -- deleteveh code
Post by: ysc3839 on Jul 08, 2015, 01:01 PM
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.
Title: Re: An error -- deleteveh code
Post by: MacTavish on Jul 08, 2015, 01:02 PM
Try

    QuerySQL( MainDB, "DELETE TABLE FROM Cars WHERE ID='" + v.ID + "'" );
Title: Re: An error -- deleteveh code
Post by: . on Jul 08, 2015, 01:52 PM
That's why this (http://forum.vc-mp.org/?topic=420.0) 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.
Title: Re: An error -- deleteveh code
Post by: ℛḝξ☂ on Jul 08, 2015, 02:15 PM
Thanks all.
solved.
Title: Re: An error -- deleteveh code
Post by: EK.IceFlake on Jul 08, 2015, 02:25 PM
Quote from: S.L.C on Jul 08, 2015, 01:52 PMThat's why this (http://forum.vc-mp.org/?topic=420.0) 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 :(