25.11.2014, 08:46
You need to put the mysql connection.
pawn Код:
new mysql;
public OnGameModeInit()
{
mysql = mysql_connect(<your_host>, <your_user>, <your_db>, <your_password>);
return 1;
}
public AutoSaveVehicles()
{
//new Query[400];
new save[400];
for(new id; id < MAX_CARS; id++)
{
new Float:health;
GetVehicleHealth(id, health);
Vehicles[id][Damage] = floatround(health);
format(save, sizeof(save), "UPDATE Vehicles SET Fuel = %d, Damage = %d WHERE SQLID = %d",Vehicles[id][Fuel],Vehicles[id][Damage],id);
mysql_query(mysql, save);
}
return 1;
}