29.07.2013, 00:15
Код:
forward AracYukle(); public AracYukle() { new resultline[1024]; new car[37][64]; new query[100]; mysql_real_escape_string("SELECT * FROM araclar ORDER BY id ASC",query); mysql_query(query); mysql_store_result(); for(new h = 0; h < sizeof(DynamicCars); h++) { while(mysql_fetch_row(resultline)==1) { H_split(resultline, car, '|'); h = AddStaticVehicleEx(strval(car[1]), floatstr(car[2]), floatstr(car[3]), floatstr(car[4]), floatstr(car[5]), strval(car[6]), strval(car[7]), -1); DynamicCars[h][cSQLid] = strval(car[0]); DynamicCars[h][CarModel] = strval(car[1]); DynamicCars[h][CarX] = floatstr(car[2]); DynamicCars[h][CarY] = floatstr(car[3]); DynamicCars[h][CarZ] = floatstr(car[4]); DynamicCars[h][CarAngle] = floatstr(car[5]); DynamicCars[h][CarColor1] = strval(car[6]); DynamicCars[h][CarColor2] = strval(car[7]); DynamicCars[h][FactionCar] = strval(car[8]); DynamicCars[h][CarType] = strval(car[9]); DynamicCars[h][CarValue] = strval(car[10]); DynamicCars[h][CarOwned] = strval(car[11]); strmid(DynamicCars[h][CarOwner], car[12], 0, strlen(car[12]), 20); strmid(DynamicCars[h][CarDescription],car[13], 0, strlen(car[13]), 20); DynamicCars[h][CarHealth] = floatstr(car[14]); DynamicCars[h][AracPatladi] = strval(car[15]); DynamicCars[h][AracKiraZaman] = strval(car[16]); DynamicCars[h][cSigorta] = strval(car[17]); DynamicCars[h][cKazaSayi] = strval(car[18]); DynamicCars[h][ModPaintjob] = strval(car[19]); DynamicCars[h][ModSpoiler] = strval(car[20]); DynamicCars[h][ModRoof] = strval(car[21]); DynamicCars[h][ModLeftSideSkirt] = strval(car[22]); DynamicCars[h][ModRightSideSkirt] = strval(car[23]); DynamicCars[h][ModExhaust] = strval(car[24]); DynamicCars[h][ModWheels] = strval(car[25]); DynamicCars[h][ModFrontBumper] = strval(car[26]); DynamicCars[h][ModRearBumper] = strval(car[27]); DynamicCars[h][ModStereo] = strval(car[28]); DynamicCars[h][ModHydraulics] = strval(car[29]); DynamicCars[h][ModNitro] = strval(car[30]); DynamicCars[h][ModNeon] = strval(car[31]); DynamicCars[h][ModAlarm] = strval(car[32]); DynamicCars[h][Panels] = strval(car[33]); DynamicCars[h][Doors] = strval(car[34]); DynamicCars[h][Lights] = strval(car[35]); DynamicCars[h][Tires] = strval(car[36]); AraciModifiyeEt(h); h++; } } }
I used MySQL plugin version:https://sampforum.blast.hk/showthread.php?tid=337810&page=20