[Help] what's wrong with this (3d txt label player)
#1

I've tried to make this 3d txt label to evry players who spawn ! but it works only with the last player spawn! we can't see the other players txt label
Код:

new Text3D:label[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
	Delete3DTextLabel(label[playerid]);
	if(team[playerid] == 1)
	{
 		label[playerid] = Create3DTextLabel("Human", 0xB4040477, 30.0, 40.0, 50.0, 40.0, 0);
	 	Update3DTextLabelText(label[playerid], 0xB4040477, "Human");
		Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
 		return 1;
	}
	if(team[playerid] == 1)
	{
 		label[playerid] = Create3DTextLabel("Animal", 0xB4040477, 30.0, 40.0, 50.0, 40.0, 0);
	 	Update3DTextLabelText(label[playerid], 0xB4040477, "Animal");
		Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
 		return 1;
	}
Reply
#2

It will work , you placed a wrong 1 there.
PHP код:
new Text3D:label[MAX_PLAYERS];
public 
OnPlayerSpawn(playerid)
{
    
Delete3DTextLabel(label[playerid]);
    if(
team[playerid] == 1)
    {
         
label[playerid] = Create3DTextLabel("Human"0xB404047730.040.050.040.00);
         
Update3DTextLabelText(label[playerid], 0xB4040477"Human");
        
Attach3DTextLabelToPlayer(label[playerid], playerid0.00.00.7);
         return 
1;
    }
    if(
team[playerid] == 2)//You have put 1 instead 2.
    
{
         
label[playerid] = Create3DTextLabel("Animal"0xB404047730.040.050.040.00);
         
Update3DTextLabelText(label[playerid], 0xB4040477"Animal");
        
Attach3DTextLabelToPlayer(label[playerid], playerid0.00.00.7);
         return 
1;
    } 
Reply
#3

yea that's what i did (just make the mistake when i was copying ) ! this isn't solving my problem
Reply
#4

What's the problem you have now?

What would happen if you use gTeam:



PHP код:
 if( gTeam[playerid] == YOURTEAM ) { 
Reply
#5

the problem is the same as the bigining ! i said that the 3d txt apear on the last player spawned only
i will not use gTeam cause i'm using team[playerid] it's exaclt the same ... well thnks for trying to help
Reply
#6

u maybe have an other suggestion ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)