20.01.2011, 13:08
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:
Just for one class:
OnPlayerDeath:
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.
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;
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;
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'.
If someone could help me with this, I would appreciate it.