cant get string from db
#1

Код:
public LoadCar(i)
{
	if(cache_get_row_count(ch))
	{
		VehInfo[i][Model] = cache_get_row_int(0, 1);
		VehInfo[i][X] = cache_get_row_float(0, 2);
		VehInfo[i][Y] = cache_get_row_float(0, 3);
		VehInfo[i][Z] = cache_get_row_float(0, 4);
		VehInfo[i][Angle] = cache_get_row_float(0, 5);
		VehInfo[i][Color] = cache_get_row_int(0, 6);
		VehInfo[i][Color2] = cache_get_row_int(0, 7);
		VehInfo[i][Ownable] = cache_get_row_int(0, 8);
		VehInfo[i][Owned] = cache_get_row_int(0, 9);
		cache_get_row(0, 10, VehInfo[i][Owner]);
		VehInfo[i][Rented] = cache_get_row_int(0, 11);
		cache_get_row(0, 12, VehInfo[i][Renter]);		
		VehInfo[i][Price] = cache_get_row_int(0, 13);
		VehInfo[i][RentPrice] = cache_get_row_int(0, 14);
		VehInfo[i][Locked] = cache_get_row_int(0, 15);
		VehInfo[i][VehId] = CreateVehicle(VehInfo[i][Model], VehInfo[i][X], VehInfo[i][Y], VehInfo[i][Z], VehInfo[i][Angle], VehInfo[i][Color], VehInfo[i][Color2], 60);
		new text[300];
		format(text, sizeof(text), "Model: %s\nOwner: %s\nRented by: %s\n", VehicleNames[VehInfo[i][Model] - 400], VehInfo[i][Owner], VehInfo[i][Renter]);
		VehInfo[i][Text] = Create3DTextLabel(text, COLOR_GREEN, VehInfo[i][X], VehInfo[i][Y], VehInfo[i][Z], 40, 0);
		Attach3DTextLabelToVehicle(VehInfo[i][Text], VehInfo[i][VehId], 0, 2, 0);
		SetVehicleNumberPlate(VehInfo[i][VehId], "RR");
	}
	return 1;
}
Reply
#2

You need to explicitly state the string length if you want to load it directly into an enumerated array.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)