20.04.2017, 10:39
Here you go:-
Код:
public LoadxVehicles() { new rows = cache_num_rows(); new id, loaded; if(rows) { while(loaded < rows) { cache_get_value_name_int(loaded, "ID", id); cache_get_value_name(loaded, "Sahip", xVehicle[id][xv_Sahip], MAX_PLAYER_NAME); cache_get_value_name_int(loaded, "Fiyat", xVehicle[id][xv_Fiyat]); cache_get_value_name_float(loaded, "X", xVehicle[id][xv_Pos][0]); cache_get_value_name_float(loaded, "Y", xVehicle[id][xv_Pos][1]); cache_get_value_name_float(loaded, "Z", xVehicle[id][xv_Pos][2]); cache_get_value_name_float(loaded, "A", xVehicle[id][xv_Pos][3]); cache_get_value_name_int(loaded, "HizliPark", xVehicle[id][xv_HizliPark]); cache_get_value_name_int(loaded, "Model", xVehicle[id][xv_ModelID]); cache_get_value_name_int(loaded, "Renk1", xVehicle[id][xv_Renk][0]); cache_get_value_name_int(loaded, "Renk2", xVehicle[id][xv_Renk][1]); cache_get_value_name(loaded, "Plaka", xVehicle[id][xv_Plaka], 8); cache_get_value_name_int(loaded, "Garajda", xVehicle[id][xv_Garajda]); cache_get_value_name_int(loaded, "PJ", xVehicle[id][xv_Paintjob]); cache_get_value_name_int(loaded, "Parca1", xVehicle[id][xv_Parca][0]); cache_get_value_name_int(loaded, "Parca2", xVehicle[id][xv_Parca][1]); cache_get_value_name_int(loaded, "Parca3", xVehicle[id][xv_Parca][2]); cache_get_value_name_int(loaded, "Parca4", xVehicle[id][xv_Parca][3]); cache_get_value_name_int(loaded, "Parca5", xVehicle[id][xv_Parca][4]); cache_get_value_name_int(loaded, "Parca6", xVehicle[id][xv_Parca][5]); cache_get_value_name_int(loaded, "Parca7", xVehicle[id][xv_Parca][6]); cache_get_value_name_int(loaded, "Parca8", xVehicle[id][xv_Parca][7]); cache_get_value_name_int(loaded, "Parca9", xVehicle[id][xv_Parca][8]); cache_get_value_name_int(loaded, "Parca10", xVehicle[id][xv_Parca][9]); cache_get_value_name_int(loaded, "Parca11", xVehicle[id][xv_Parca][10]); cache_get_value_name_int(loaded, "Parca12", xVehicle[id][xv_Parca][11]); cache_get_value_name_int(loaded, "Parca13", xVehicle[id][xv_Parca][12]); cache_get_value_name_int(loaded, "Parca14", xVehicle[id][xv_Parca][13]); if(!xVehicle[id][xv_Garajda]) { xVehicle[id][xv_Veh] = CreateVehicle(xVehicle[id][xv_ModelID], xVehicle[id][xv_Pos][0], xVehicle[id][xv_Pos][1], xVehicle[id][xv_Pos][2], xVehicle[id][xv_Pos][3], xVehicle[id][xv_Renk][0], xVehicle[id][xv_Renk][1], -1); xVeh[xVehicle[id][xv_Veh]] = id; SetVehicleNumberPlate(xVehicle[id][xv_Veh], xVehicle[id][xv_Plaka]); SetVehicleToRespawn(xVehicle[id][xv_Veh]); } Iter_Add(xVehicles, id); loaded++; if(!strlen(xVehicle[id][xv_Sahip])) { new str[150]; format(str, sizeof(str), "{FF0000}This Vehicle Is For Sale!\n{FF0000}Vehicle Name: {04FF00}%s\n{FF0000}Plate Number: {04FF00}%s\n{FF0000}Price: {04FF00}$%d", GetVehicleNameFromModel(xVehicle[id][xv_ModelID]), xVehicle[id][xv_Plaka], xVehicle[id][xv_Fiyat]); xVehicle[id][xv_Text] = Create3DTextLabel(str, 0x008080FF, 0.0, 0.0, 0.0, 15.0, 0); Attach3DTextLabelToVehicle(xVehicle[id][xv_Text], xVehicle[id][xv_Veh], 0.0, 0.0, 1.0); SendClientMessage(id, -1, "{FF0000}[ERROR]{0098FF}:- You Dont have Keys This car.{FFFFFF}."); } else { new str[150]; format(str, sizeof(str), "{FF0000}Vehicle By: {8B8B8B}%s", xVehicle[id][xv_Sahip]); xVehicle[id][xv_Text] = Create3DTextLabel ( str, 0xFF0000FF, 0.0, 0.0, 0.0, 15.0, 0, 1 ); Attach3DTextLabelToVehicle ( xVehicle[id][xv_Text], xVehicle[id][xv_Veh], 0.0, 0.0, 0.0 ); } } } printf("[xVehicle] %d vehicle loaded.", loaded); return 1; }