PDA

View Full Version : Attaching 3D Text Labels with Incognitos Streamer


Giovanni
28/12/2011, 11:14 AM
I somehow can't get this stuff working.
I load all my vehicles out of text files, that all works fine. But I somehow can not attach 3D Text Labels to them. In my code I got following line:


VehicleInfo[idx][vLabel] = CreateDynamic3DTextLabel(vehiclestring,c_red,0.0,0 .0,0.0,40.0,INVALID_PLAYER_ID,VehicleInfo[idx][vID]);


The last parameter of CreateDynamic3DTextLabel which I used is for the vehicle you want to attach the label to.

Those vehicles are being created a bit earlier with following line:

VehicleInfo[idx][vID] = CreateVehicle( ... )


I am kind of stuck right now and I don't really know what I am doing wrong.

Sasino97
28/12/2011, 01:01 PM
Any compiler errors?

Giovanni
28/12/2011, 04:54 PM
Sasino97;1596032']Any compiler errors?

No, there aren't.

Ash.
28/12/2011, 05:37 PM
What is in the variable called "vehiclestring"?

Sharingan...
28/12/2011, 07:04 PM
Maybe because it's under the car, try to putting a little height with the z coord. Like this:

VehicleInfo[idx][vLabel] = CreateDynamic3DTextLabel(vehiclestring,c_red,0.0,0 .0,0.8,40.0,INVALID_PLAYER_ID,VehicleInfo[idx][vID]);

Ash.
28/12/2011, 07:28 PM
Maybe because it's under the car, try to putting a little height with the z coord. Like this:

VehicleInfo[idx][vLabel] = CreateDynamic3DTextLabel(vehiclestring,c_red,0.0,0 .0,0.8,40.0,INVALID_PLAYER_ID,VehicleInfo[idx][vID]);


The x, y, and z co-ordinates are irrelevant when attaching text labels to players or vehicles.
Also, even if it were "under the car", they'd still be visible as text labels are visible through vehicles, whether testlos is enabled or not.

Giovanni
29/12/2011, 01:08 AM
What is in the variable called "vehiclestring"?

It just shows informations about the vehicle, like the owner etc.:


format(vehiclestring,sizeof(vehiclestring),"Owner: %s",VehicleInfo[idx][vOwner]);




Edit:

I have found the bug. The part where this code was located didn't get fully loaded (some parts, but not all of them). I have fixed this now.


Thanks for your fast help though, I really appreciate that!