11.12.2014, 20:10
You should use escape strings instead of regular strings to prevent MYSQL injections (%e).
In this code you're selecting all data. If you just want the vehicle model ID then you only need to select that row.
But ideally all of this data should be loaded once a player logs in, and since this player is online you could just use the variables from the script rather than a MYSQL query.
Код:
format(string, sizeof(string), "SELECT * FROM vehicles WHERE Owner = '%s'", Name(playerid));
Код:
format(string, sizeof(string), "SELECT `vehiclemodel` FROM `vehicles` WHERE `Owner` = '%e'", Name(playerid));