AttachPlayer3DTextLabel ?? -
JaKe Elite - 10.04.2013
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!
Re: AttachPlayer3DTextLabel ?? -
fordawinzz - 10.04.2013
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.
Re: AttachPlayer3DTextLabel ?? -
JaKe Elite - 10.04.2013
Код:
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.
Re: AttachPlayer3DTextLabel ?? -
Riddick94 - 10.04.2013
Could you please, show us, how you're creating a label?
Re: AttachPlayer3DTextLabel ?? -
Pottus - 10.04.2013
Attaching 3D Labels is very buggy Romel at least attaching them to players I would avoid using them like this.
Re: AttachPlayer3DTextLabel ?? -
JaKe Elite - 10.04.2013
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.
Re: AttachPlayer3DTextLabel ?? -
iJumbo - 10.04.2013
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
Re: AttachPlayer3DTextLabel ?? -
Riddick94 - 10.04.2013
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:
To declare Player 3D Text Label you have to use tag:
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.
Re: AttachPlayer3DTextLabel ?? -
JaKe Elite - 10.04.2013
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);
}
}
Re: AttachPlayer3DTextLabel ?? -
Riddick94 - 10.04.2013
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.