29.05.2012, 16:56
Que tal.
Ya que comenze a ver MySQL trate de pasar los vehiculos a mysql no me salta ningun warning
pero al poner el callback en ongamemode init para que comienze a cargar los autos no cargan...
Ya que comenze a ver MySQL trate de pasar los vehiculos a mysql no me salta ningun warning
pero al poner el callback en ongamemode init para que comienze a cargar los autos no cargan...
pawn Код:
forward LoadVehFromDb();
public LoadVehFromDb()
{//1
print("ЎActived!");
new ccc;
{//2
MySQLCheck();
if(mysql_num_rows() != 0)
{//3
new Data[1024];
new Field[64];
new rcnt = 1;
new query[300];
for(new vehicleid=1; vehicleid<MAX_VEHICLES; vehicleid++)
{//4
format(query,sizeof(query),"SELECT * FROM `"TABLECARS"` WHERE "CARSQLID" = '%d'",vehicleid);
mysql_query(query);
mysql_store_result();
samp_mysql_fetch_row(Data);
samp_mysql_strtok(Field, "|", Data);
while (samp_mysql_strtok(Field, "|", "")==1)
{//5
ccc ++;
if (rcnt == 1) CarInfo[vehicleid][cModel] = strval(Field);
if (rcnt == 2) CarInfo[vehicleid][cLocationx] = strval(Field);
if (rcnt == 3) CarInfo[vehicleid][cLocationy] = strval(Field);
if (rcnt == 4) CarInfo[vehicleid][cLocationz] = strval(Field);
if (rcnt == 5) CarInfo[vehicleid][cAngle] = strval(Field);
if (rcnt == 6) CarInfo[vehicleid][cColorOne] = strval(Field);
if (rcnt == 7) CarInfo[vehicleid][cColorTwo] = strval(Field);
if (rcnt == 8) CarInfo[vehicleid][cOwner] = strval(Field);
if (rcnt == 9) CarInfo[vehicleid][cName] = strval(Field);
if (rcnt == 10) CarInfo[vehicleid][cValue] = strval(Field);
if (rcnt == 11) CarInfo[vehicleid][cOwned] = strval(Field);
if (rcnt == 12) CarInfo[vehicleid][cLock] = strval(Field);
if (rcnt == 13) CarInfo[vehicleid][cBattery] = strval(Field);
if (rcnt == 14) CarInfo[vehicleid][cSpoiler] = strval(Field);
if (rcnt == 15) CarInfo[vehicleid][cHood] = strval(Field);
if (rcnt == 16) CarInfo[vehicleid][cRoof] = strval(Field);
if (rcnt == 17) CarInfo[vehicleid][cSideskirt] = strval(Field);
if (rcnt == 18) CarInfo[vehicleid][cNitro] = strval(Field);
if (rcnt == 19) CarInfo[vehicleid][cLamps] = strval(Field);
if (rcnt == 20) CarInfo[vehicleid][cExhaust] = strval(Field);
if (rcnt == 21) CarInfo[vehicleid][cWheel] = strval(Field);
if (rcnt == 22) CarInfo[vehicleid][cHydraulics] = strval(Field);
if (rcnt == 23) CarInfo[vehicleid][cPaintjob] = strval(Field);
if (rcnt == 24) CarInfo[vehicleid][cFrontBumper] = strval(Field);
if (rcnt == 25) CarInfo[vehicleid][cRearBumper] = strval(Field);
if (rcnt == 26) CarInfo[vehicleid][cVents] = strval(Field);
if (rcnt == 27) CarInfo[vehicleid][cEmbargo] = strval(Field);
if (rcnt == 28) CarInfo[vehicleid][cMulta] = strval(Field);
if (rcnt == 29) CarInfo[vehicleid][cPlate] = strval(Field);
if (rcnt == 30) CarInfo[vehicleid][cGas] = strval(Field);
if (rcnt == 31) CarInfo[vehicleid][cAlarm] = strval(Field);
if (rcnt == 32) CarInfo[vehicleid][cNeon] = strval(Field);
if (rcnt == 33) CarInfo[vehicleid][cInterior] = strval(Field);
if (rcnt == 34) CarInfo[vehicleid][cVirtual] = strval(Field);
if (rcnt == 35) CarInfo[vehicleid][cIdentificador] = strval(Field);
if (rcnt == 36) CarInfo[vehicleid][cDano] = strval(Field);
if (rcnt == 37) CarInfo[vehicleid][cPanelDamag] = strval(Field);
if (rcnt == 38) CarInfo[vehicleid][cPuertasDamag] = strval(Field);
if (rcnt == 39) CarInfo[vehicleid][cLucesDamage] = strval(Field);
if (rcnt == 40) CarInfo[vehicleid][cRuedasDamag] = strval(Field);
if (rcnt == 41) CarInfo[vehicleid][IsIntermitente] = strval(Field);
if (rcnt == 42) CarInfo[vehicleid][ConteoIntermitente] = strval(Field);
if (rcnt == 43) CarInfo[vehicleid][LightState] = strval(Field);
ownedcar[vehicleid] = AddStaticVehicleEx(CarInfo[vehicleid][cModel],
CarInfo[vehicleid][cLocationx],
CarInfo[vehicleid][cLocationy],
CarInfo[vehicleid][cLocationz],
CarInfo[vehicleid][cAngle],
CarInfo[vehicleid][cColorOne],CarInfo[vehicleid][cColorTwo],-1);
SetVehicleNumberPlate(ownedcar[vehicleid],CarInfo[vehicleid][cPlate]);
SetVehicleToRespawn(ownedcar[vehicleid]);
rcnt++;
}
}
}
}
mysql_free_result();
printf("Total Vehicles Loaded: %d",ccc);
return 1;
}