Delete3DTextLabel doesn't work
#1

I've got this code:
Код:
public OnVehicleSpawn(vehicleid)
{
	Delete3DTextLabel(Text3D:VehicleData[vehicleid][LockedLabelID]);
	VehicleData[vehicleid][LockedLabelID] = -1;
	printf("OnVehicleSpawn(vehicleid = %d)", vehicleid);
	return 1;
}
Console showed
Quote:

OnVehicleSpawn(vehicleid = 102)

, but the 3D Text still exists

I added:
Код:
printf("%d", VehicleData[vehicleid][LockedLabelID]);
, console showed
Quote:

6

.

Creating code:
Код:
				VehicleData[vehicleid][LockedLabelID] = _:Create3DTextLabel("No fuel", 0xDDB950FF, 0.0, 0.0, 0.0, 30.0, 0);
				Attach3DTextLabelToVehicle(Text3D:VehicleData[vehicleid][LockedLabelID], vehicleid, 0.0, 0.0, 1.0);
Any ideas?
Reply
#2

What's up with the _: before the Create3DTextLabel? delete that part.
Reply
#3

Also this code is wrong:
Код:
Attach3DTextLabelToVehicle(Text3D:VehicleData[vehicleid][LockedLabelID], vehicleid, 0.0, 0.0, 1.0);
You have to use:
Код:
new Text3D:VehicleData[vehicleid][LockedLabelID];
when you create it.
Reply
#4

PAWN doesn't have arrays types. These Float:, Text3D: are only for remove tag mismatch warning, _: changes them to normal, without tag (if we've got an array without "tag" and want to save a value which is tagged, we need to use _: ).

I changed it and didn't helped.

EDIT:
I changed the line to:
Код:
printf("%d", Delete3DTextLabel(VehicleData[vehicleid][LockedLabelID]));
Console showed 1
Reply
#5

EDIT:
Dunno why, but it fixed itself....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)