Hiding a 3d Text label
#1

Ok, so I'm trying to hide the 3d textlabel that is attached to a vehicle when a player enters it.. right now it just stays on the vehicle.. I keep getting an error when I compile -- error 017: undefined symbol "carid"

Below is the code that attaches the 3d text label \
Код:
{
  format(Str, sizeof(Str), "%s\nOwner: %s", GetVehicleFriendlyName(carid2),vehOwnedBy);
  PVInfo[carid][vpVehicleText] = Create3DTextLabel(Str, 0xFF8400FF, vehX, vehY, vehZ, 50.0, 0, 1);
}
below is the code to hide the text label
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) // Player entered a vehicle as a driver or passenger
    {
        TextDrawHideForAll(PVInfo[carid][vpVehicleText]);
    }
Reply
#2

Text labels and text draws are completely different. The only way you can hide a text label is by either deleting it, making the text blank, or giving the color 0 alpha.
Reply
#3

ohhh ok because this is my new code i just changed, and now its giving me a warning when I compile "warning 213: tag mismatch"

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) // Player entered a vehicle as a driver or passenger
    {
        TextDrawShowForAll(vpVehicleText);
    }
that would explain the warning. So I would need to change that function to "delete3dtextlabel"?
Reply
#4

Good idea, make the text completely transparent
Reply
#5

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
Text labels and text draws are completely different. The only way you can hide a text label is by either deleting it, making the text blank, or giving the color 0 alpha.
ok here is the new onpublicstatechange line

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) // Player entered a vehicle as a driver or passenger
    {
        Update3DTextLabelText(vpVehicleText, 0xFF840000, "The High Life");
    }
Now i'm getting a warning message on compile "warning 213: tag mismatch" again.. I'm not sure what i'm doing wrong here
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)