Help with 3D Text Labels -
ExeC - 20.01.2011
Okay, hello. I've made 4 classes to my CoD server, and I'm making 3D text labels to show if a player is, for example: Engineer.
I just can't get them work, they worked one time like, that it showed the text on the players head, but when player died & spawned and chose a new class, it messed up.
Then I tried to do something else, and I ended up with this:
pawn Код:
new PlayerText3D:Recon;
new PlayerText3D:Engineer;
new PlayerText3D:Medic;
new PlayerText3D:Assault;
Just for one class:
pawn Код:
Recon = CreatePlayer3DTextLabel(playerid,"Recon",0x000FFFFF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Text3D:Recon, playerid, 0.0, 0.0, 0.7);
IsRecon[playerid] = 1;
OnPlayerDeath:
pawn Код:
if(IsRecon[playerid] == 1)
{
UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Recon, 0xFFFA00FF, " ");
DeletePlayer3DTextLabel(playerid, PlayerText3D:Recon);
}
if(IsAssault[playerid] == 1)
{
UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Assault, 0xFFFA00FF, " ");
DeletePlayer3DTextLabel(playerid, PlayerText3D:Assault);
}
if(IsMedic[playerid] == 1)
{
UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Medic, 0xFFFA00FF, " ");
DeletePlayer3DTextLabel(playerid, PlayerText3D:Medic);
}
if(IsEngineer[playerid] == 1)
{
UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Engineer, 0xFFFA00FF, " ");
DeletePlayer3DTextLabel(playerid, PlayerText3D:Engineer);
}
IsMedic[playerid] = 0;
IsRecon[playerid] = 0;
IsAssault[playerid] = 0;
IsEngineer[playerid] = 0;
//These are also in 'OnPlayerConnect', and 'OnPlayerDisconnect'.
That ain't working either. The problem is with that, that sometimes it creates a 3D text label, but far, far away from the player, and I can't find nothing wrong in the code. Annoying.
If someone could help me with this, I would appreciate it.
Re: Help with 3D Text Labels -
Infamous - 20.01.2011
Try it like this..
Just for one class:
pawn Код:
Recon = CreatePlayer3DTextLabel(playerid,"Recon",0x000FFFFF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Recon, playerid, 0.0, 0.0, 0.7);
IsRecon[playerid] = 1;
Just removed 'PlayerText3D:Recon' from the line above and simply put 'Recon' try that under all of the lines you have used 'PlayerText3D:Var'.
Re: Help with 3D Text Labels -
ExeC - 20.01.2011
Quote:
Originally Posted by Infamous
pawn Код:
Recon = CreatePlayer3DTextLabel(playerid,"Recon",0x000FFFFF,30.0,40.0,50.0,40.0,0); Attach3DTextLabelToPlayer(Recon, playerid, 0.0, 0.0, 0.7); IsRecon[playerid] = 1;
|
pawn Код:
warning 213: tag mismatch
When removed 'Text3D:'.
Re: Help with 3D Text Labels -
Infamous - 20.01.2011
Why don't you go with Text3D instead of Player3DText and attatch MAX_PLAYERS to your variables. would work just as well.
I don't think I can help other than that mate, I would have thought Player3DText works the same way as Text3D.
Re: Help with 3D Text Labels -
Toreno - 20.01.2011
pawn Код:
new Text3D:Recon[MAX_PLAYERS];
new Text3D:Engineer[MAX_PLAYERS];
new Text3D:Medic[MAX_PLAYERS];
new Text3D:Assault[MAX_PLAYERS];
pawn Код:
Recon[playerid] = Create3DTextLabel("Recon",0x000FFFFF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Recon[playerid], playerid, 0.0, 0.0, 0.7);
IsRecon[playerid] = 1;
Re: Help with 3D Text Labels -
ExeC - 21.01.2011
Quote:
Originally Posted by EliranPesahov
pawn Код:
new Text3D:Recon[MAX_PLAYERS]; new Text3D:Engineer[MAX_PLAYERS]; new Text3D:Medic[MAX_PLAYERS]; new Text3D:Assault[MAX_PLAYERS];
pawn Код:
Recon[playerid] = Create3DTextLabel("Recon",0x000FFFFF,30.0,40.0,50.0,40.0,0); Attach3DTextLabelToPlayer(Recon[playerid], playerid, 0.0, 0.0, 0.7); IsRecon[playerid] = 1;
|
Wow, thanks. That worked. I thought that I already tried that, but no
. Thanks.