AttachPlayer3DTextLabel ??
#1

I've tried this

pawn Код:
Attach3DTextLabelToVehicle(Speedo[playerid], GetPlayerVehicleID(playerid), 0.0, 0.0, 0.0);
But end up in tag mismatch.

Is there possible to attach Player3DText Label to vehicles?

No not Text3D. I'm creating a 3d text label for each (per) players not for normal ones!
Reply
#2

Did you create the 3dtext like this?
pawn Код:
new Text3D: Speedo[MAX_PLAYERS];


how could you attach player texts to vehicles ? this makes no sense.
Reply
#3



Код:
No not Text3D. I'm creating a 3d text label for each (per) players not for normal ones!
Yes i've tried one. But it gets bugged when there is 4 players using the label.
I'm creating speedometer label.
Reply
#4

Could you please, show us, how you're creating a label?
Reply
#5

Attaching 3D Labels is very buggy Romel at least attaching them to players I would avoid using them like this.
Reply
#6

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
Could you please, show us, how you're creating a label?
pawn Код:
Speedo[playerid] = CreatePlayer3DTextLabel(playerid, " ", -1, 0.0, 0.0, 0.0, 50.0, 0, 0);
i update them when player is in the vehicle.
Reply
#7

Should be
pawn Код:
new Text3D:Speedo[MAX_VEHICLES];
OnYouCreateVeh
    vehicleid = createvehicle bla b la
    Speedo[vehicleid] = Create3DTex
    Attach3DTextLabelToVehicle( Speedo[vehicleid],vehicleid
You cant attach a per player becouse attach3D need to be defined with vehicles

EDIT: just an idea comes you can attach the PlayerLabel to player so seems to be in vehicle
Reply
#8

So I made a quick test in compiler for it, and warning occurs, and the solution for me was:

pawn Код:
new Text3D:Speedo[MAX_PLAYERS];
Tag: Text3D before declaring Speedo. I forget to put it there, then I added it and it compiled fine. Are you sure, that you have Text3D tag before creating player array?

edit://
WAIT!

I noticed now, that you're using:
pawn Код:
CreatePlayer3DTextLabel
To declare Player 3D Text Label you have to use tag:

pawn Код:
PlayerText3D:
So, obviously, you're not allowed to use Attach3DTextLabelToVehicle function, because it's using standard 3DText label tag. However, if you're using player array to create 3DText label, you can use Create3DTextLabel, but other players gonna see that label.
Reply
#9

Quote:
Originally Posted by iJumbo
Посмотреть сообщение
Should be
pawn Код:
new Text3D:Speedo[MAX_VEHICLES];
OnYouCreateVeh
    vehicleid = createvehicle bla b la
    Speedo[vehicleid] = Create3DTex
    Attach3DTextLabelToVehicle( Speedo[vehicleid],vehicleid
You cant attach a per player becouse attach3D need to be defined with vehicles

EDIT: just an idea comes you can attach the PlayerLabel to player so seems to be in vehicle
Now it doesn't work

pawn Код:
for(new i; i < MAX_VEHICLES; i++)
        Speedo[i] =  Create3DTextLabel(" ", -1, 0.0, 0.0, 0.0, 50.0, 0, 0);
pawn Код:
if(pInfo[playerid][Speedos] == 1)
        {
            Attach3DTextLabelToVehicle(Speedo[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), 0.0, 0.0, 0.0);
            Update3DTextLabelText(Speedo[GetPlayerVehicleID(playerid)], COLOR_YELLOW, "Vehicle Name:\nSpeed km/h:\nHealth:\nuse /vehctrl");
        }
pawn Код:
if(pInfo[playerid][Speedos] == 1)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new Float:vh;
            new vid = GetPlayerVehicleID(playerid);
            new h, string[200];
            GetVehicleHealth(vid, vh);
            h = floatround(vh) / 10;
            new Float:speed = GetPlayerSpeed(playerid);
            new ss = floatround(speed);
            format(string, sizeof(string), ""white"-----------------\n"yellow"Vehicle Name: %s\nSpeed km/h: %i\nHealth: %s%i"COL_YELLOW"\nuse /vehctrl\n"white"-----------------", VehicleName[GetVehicleModel(GetPlayerVehicleID(playerid)) - 400], ss, DamageColor(h), h);
            Update3DTextLabelText(Speedo[vid], COLOR_YELLOW, string);
        }
    }
Reply
#10

Why don't you create a 3DText label when player is a driver and then destroy it when he's on foot? You don't need a loop for that, try OnPlayerStateChange callback.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)