09.02.2013, 19:34
I'm using Attach3DTextLabelToVehicle....Although when the vehicle moves, the textlabel stays where it was created.
pawn Code:
if(VehForSale[vehicleid] == 0)
{
VehForSale[vehicleid] = 1;
new string[128];
new name = VehModel[vehicleid] - 400;
new Float: x, Float: y, Float: z;
MySQL_SetInteger(vehicleid, "VehForSale", 1, "vehicles");
GetVehiclePos(vehicleid, x,y,z);
printf("vehicleid %d", vehicleid);
format(string, sizeof(string), "%s, $%d, %s", VehicleNames[name], VehPrice[vehicleid], VehPlate[vehicleid]);
VehicleLabel[vehicleid] = CreateDynamic3DTextLabel(string, COLOUR_WHITE, x,y, z, 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, -1, -1, 20.0);
printf("VehicleLabelID %d", vehicleid);
printf("x - %f, y - %f, z - %f", x, y, z);
Attach3DTextLabelToVehicle(VehicleLabel[vehicleid] ,vehicleid,0.0,0.0,0.0);// THIS PART.
SendClientMessage(playerid, COLOUR_WHITE, "Business vehicle is now for sale.");
}