Why will this not remain with the vehicle? -
Dokins - 09.02.2013
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.");
}
Re: Why will this not remain with the vehicle? -
park4bmx - 09.02.2013
It all looks fine, but have you tried the normal "Create3DTextLabel", see if it works with that ?
And also show how you defined "VehicleLabel"
Re: Why will this not remain with the vehicle? -
Dokins - 09.02.2013
pawn Code:
new Text3D: VehicleLabel[MAX_VEHICLES];
Alright, the issue is that loaded vehicles are fine when the script starts.
However, when I create a new vehicle (dealer buys) it returns command not recognized when trying to make it /forsale.
Re: Why will this not remain with the vehicle? -
Memoryz - 09.02.2013
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, VehicleLabel[vehicleid] , 0, 0, -1, -1, 20.0);
printf("VehicleLabelID %d", vehicleid);
printf("x - %f, y - %f, z - %f", x, y, z);
SendClientMessage(playerid, COLOUR_WHITE, "Business vehicle is now for sale.");
}
Try this.
Re: Why will this not remain with the vehicle? -
Dokins - 09.02.2013
Thank you very much.