Why will this not remain with the vehicle?
#1

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.");
    }
Reply
#2

It all looks fine, but have you tried the normal "Create3DTextLabel", see if it works with that ?
And also show how you defined "VehicleLabel"
Reply
#3

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.
Reply
#4

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.
Reply
#5

Thank you very much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)