CMD:vehicleinfo(playerid,params[])
{
new string[128];
new plate[11];
new query[400];
if(sscanf(params, "s[11]", plate)) return SendClientMessage(playerid, COLOR_RED, "> The correct usage of this command would be: /vehicleinfo vehicleplate");
format(query, sizeof(query), "SELECT * FROM Vehicles WHERE Plate = '%s'", plate);
mysql_query(query);
mysql_store_result();
return 1;
}
sscanf(Query, "p<|>e<idffffddds[11]ddds[24]ddd>", Vehicles[id]);
CMD:vehicleinfo(playerid,params[])
{
new string[128];
new plate[11];
new query[40+sizeof(plate)];
if(sscanf(params, "s[11]", plate)) return SendClientMessage(playerid, COLOR_RED, "> The correct usage of this command would be: /vehicleinfo vehicleplate");
format(query, sizeof(query), "SELECT * FROM Vehicles WHERE Plate = \'%s\'", plate);
mysql_query(query);
mysql_store_result();
if(mysql_retrieve_row()) {
new content[40];
mysql_fetch_field_row(content, "modelid");
// the string "content" now contains the field "modelid"
new model = strval(content);
// the var "model" now has the model from the database as an integer
}
else {
SendClientMessage(playerid, COLOR_RED, "That vehicle doesn't exist.");
}
return 1;
}
format(query, sizeof(query), "SELECT * FROM Vehicles WHERE Plate = \'%s\'", plate);
\'%s\'
Vehicles[model][Ownername]
Alright for the
pawn Код:
pawn Код:
|
Also, just to ensure im not stupid, I could then go about by doing something like
pawn Код:
|
if(mysql_retrieve_row())
{
new content[40];
mysql_fetch_field_row(content, "SQLID");
new vid = strval(content);
format(string, sizeof(string), "> Vehicle Owner: %s ", Vehicles[vid][Owner]);
SendClientMessage(playerid, COLOR_WHITE, string);
}