public MySQL_Vehicle_Load(i){ new query[300]; mysql_format(mysql_connection, query, sizeof(query), \"SELECT * FROM vehicles WHERE vehid = \'%d\'\", i);mysql_query(mysql_connection, query);new rows, fields;cache_get_data(rows, fields);if(rows){ vInfo[vehid] = cache_get_row_int(0,0);vInfo[modelid] = cache_get_row_int(0,1);vInfo[vcolor1] = cache_get_row_int(0,2);vInfo[vcolor2] = cache_get_row_int(0,3);vInfo[vprice] = cache_get_row_int(0,4);vInfo[beowner] = cache_get_row_int(0,5);cache_get_row(0,6, vInfo[owner]);vInfo[door] = cache_get_row_int(0,7);vInfo[posx] = cache_get_row_float(0,8);vInfo[posy] = cache_get_row_float(0,9);vInfo[posz] = cache_get_row_float(0,10);vInfo[posa] = cache_get_row_float(0,11);CreateVehicle(vInfo[modelid], vInfo[posx], vInfo[posy], vInfo[posz], vInfo[posa], vInfo[vcolor1], vInfo[vcolor2], -1);SetVehicleNumberPlate(i, vInfo[vehid]);SetVehicleParamsEx(i, 1, 0, 0, vInfo[door], 0, 0, 0);}else{ format(query, sizeof(query), \"INSERT INTO vehicles (vehid, modelid, vcolor1, vcolor2, vprice, beowner, owner, door, posx, posy, posz, posa) VALUES (\'%d\', \'441\', \'0\', \'0\', \'0\', \'0\', \'\', \'0\', \'0.0\', \'0.0\', \'10.0\', \'0.0\')\", i);mysql_query(mysql_connection, query);MySQL_Vehicle_Load(i);}return 1;}
for(new i = 1; i <= 20; i++){ MySQL_Vehicle_Load(i);}
AddStaticVehicleEx(469, 2405.5474, 91.5263, 26.4872, 178.7658, 1, 3, -1);
AddStaticVehicleEx(469, 2405.5474, 91.5263, 26.4872, 178.7658, 1, 3, 0);
public OnGameModeInit(){UsePlayerPedAnims();SetGameModeText(\"JT-RP v1.0\");mysql_log(LOG_ALL, LOG_TYPE_HTML);ConnectMySQL();if(mysql_errno(mysql_connection) != 0) printf(\"MySQL hibakód: %d\", mysql_errno(mysql_connection));if(mysql_errno(mysql_login_connection) != 0) printf(\"MySQL hibakód: %d\", mysql_errno(mysql_login_connection));//Betöltés==================================================================for(new i = 1; i <= VEHICLES; i++){ MySQL_Vehicle_Load(i);}print(\"KÉSZ\");//SpawnPointok==============================================================AddPlayerClass(0,2414.6580,92.3942,26.4706,90.0,0,0,0,0,0,0);//Jármûvek==================================================================AddStaticVehicleEx(469, 2405.5474, 91.5263, 26.4872, 178.7658, 1, 3, -1);//3D textek=================================================================Create3DTextLabel(\"[2 ajtós]\", COLOR_SYSTEM, 2417.5493, 87.7860, 26.4707, 20.0,0);Create3DTextLabel(\"[4 ajtós]\", COLOR_SYSTEM, 2420.6138, 90.5424, 26.4766, 20.0,0);Create3DTextLabel(\"[Terepjárók]\", COLOR_SYSTEM, 2419.1887, 94.7686, 26.4766, 20.0,0);Create3DTextLabel(\"[Motorok]\", COLOR_SYSTEM, 2412.3584, 87.3973, 26.4732, 20.0,0);Create3DTextLabel(\"[Helikopterek]\", COLOR_SYSTEM, 2414.6580, 92.3942, 26.4706, 20.0,0);Create3DTextLabel(\"[sportkocsik]\", COLOR_SYSTEM, 2415.6890, 96.9316, 26.4766, 20.0,0); for(new i = 0; i <= PLAYERS; i++){ //text 1IRANY:csökk:bal növ:jobb 2IRANY: csökk: fel növ:lejarmumutat = TextDrawCreate(380.0, 200.0, \"_\");TextDrawFont(jarmumutat, TEXT_DRAW_FONT_MODEL_PREVIEW);TextDrawUseBox(jarmumutat, 1);TextDrawBoxColor(jarmumutat, 0x000000FF);TextDrawTextSize(jarmumutat, 40.0, 40.0);TextDrawSetPreviewModel(jarmumutat, 441);TextDrawSetPreviewVehCol(jarmumutat, 1, 1);TextDrawSetPreviewRot(jarmumutat, -50.0, 0.0, -90.0, 1.0);}return 1;}
public MySQL_Vehicle_Load(i){ new query[300]; format(query, sizeof(query), \"SELECT * FROM `vehicles` WHERE `vehid` = \'%d\'\", i);mysql_query(mysql_connection, query);new rows = cache_get_row_count();if(rows == 1){ vInfo[vehid] = cache_get_row_int(0,0);vInfo[modelid] = cache_get_row_int(0,1);vInfo[vcolor1] = cache_get_row_int(0,2);vInfo[vcolor2] = cache_get_row_int(0,3);vInfo[vprice] = cache_get_row_int(0,4);vInfo[beowner] = cache_get_row_int(0,5);cache_get_row(0,6, vInfo[owner]);vInfo[door] = cache_get_row_int(0,7);vInfo[posx] = cache_get_row_float(0,8);vInfo[posy] = cache_get_row_float(0,9);vInfo[posz] = cache_get_row_float(0,10);vInfo[posa] = cache_get_row_float(0,11);CreateVehicle(vInfo[modelid], vInfo[posx], vInfo[posy], vInfo[posz], vInfo[posa], vInfo[vcolor1], vInfo[vcolor2], -1);SetVehicleNumberPlate(i, vInfo[vehid]);SetVehicleParamsEx(i, 1, 0, 0, vInfo[door], 0, 0, 0);}else{ format(query, sizeof(query), \"INSERT INTO `vehicles` (vehid, modelid, vcolor1, vcolor2, vprice, beowner, owner, door, posx, posy, posz, posa) VALUES (\'%d\', \'441\', \'0\', \'0\', \'0\', \'0\', \'\', \'0\', \'0.0\', \'0.0\', \'10.0\', \'0.0\')\", i);mysql_query(mysql_connection, query);printf(\"[sYSTEM MESSAGE] %d számú jármû létrehozva!\", i);MySQL_Vehicle_Load(i);}return 1;}
if(rows != 1)
new query[300];format(query, sizeof(query), \"SELECT * FROM `vehicles` WHERE `vehid` = \'%d\'\", i);mysql_query(mysql_connection, query);new rows = cache_get_row_count();if(rows == 1){ printf(\"[sYSTEM MESSAGE] %d számú jármû Betöltése:\", i); vInfo[vehid] = cache_get_row_int(0,0);vInfo[modelid] = cache_get_row_int(0,1);vInfo[vcolor1] = cache_get_row_int(0,2);vInfo[vcolor2] = cache_get_row_int(0,3);vInfo[vprice] = cache_get_row_int(0,4);vInfo[beowner] = cache_get_row_int(0,5);cache_get_row(0,6, vInfo[owner]);vInfo[door] = cache_get_row_int(0,7);vInfo[posx] = cache_get_row_float(0,8);vInfo[posy] = cache_get_row_float(0,9);vInfo[posz] = cache_get_row_float(0,10);vInfo[posa] = cache_get_row_float(0,11);CreateVehicle(vInfo[modelid], vInfo[posx], vInfo[posy], vInfo[posz], vInfo[posa], vInfo[vcolor1], vInfo[vcolor2], -1);SetVehicleNumberPlate(i, vInfo[vehid]);SetVehicleParamsEx(i, 1, 0, 0, vInfo[door], 0, 0, 0);}
for(new i = 1; i <= 20; i++) { MySQL_Vehicle_Load(i); }
for(new i = 0; i <= 20; i++) { MySQL_Vehicle_Load(i); }
for(new i = 1; i < VEHICLES; i++){MySQL_Vehicle_Load(i); print(\"KÉSZ\");}