24.01.2014, 19:26
Check the wiki for the latest natives and their examples: https://sampwiki.blast.hk/wiki/MySQL/R33 (This is updated for R35 recently by maddinat0r)
pawn Код:
// This is just an example.
stock LoadVehicles()
{
// Edit the 1 to your connection handle.
mysql_tquery(1, "SELECT * FROM vehicles", "LoadVehicleMySQL");
}
forward public LoadVehicleMySQL;
public LoadVehicleMySQL()
{
for(new yy=0; yy < cache_get_row_count(); ++yy)
{
cache_get_row(yy, 0, VehicleInfo[id][Model]);
cache_get_row_float(yy, 1, VehicleInfo[id][Pos][X]);
cache_get_row_float(yy, 2, VehicleInfo[id][Pos][Y]);
// This isn't completed yet, now do the rest.
}
return true;
}