3D Text Update
#1

Hi, I've got:

At the top of gamemode:
new Text3D:level[100];

OnPlayerDisconnect:
Delete3DTextLabel(level[playerid]);

OnGamemodeInit:
SetTimer("level2", 4000, 1);

When player is logged in successfully:
format(str33, 256, "Level: %d Exp: %d/%d", something, something, something);
level[playerid] = Create3DTextLabel(str33,0xFFFF00AA,0.0,0.0,0.0,15. 0,0);
Attach3DTextLabelToPlayer(level[playerid], playerid, 0.0, 0.0, -0.4);

At the bottom of it:
forward level2(playerid);
public level2(playerid)
{
someting...
}
}
format(str, 256, "Level: %d Exp: %d/%d", blah, blah, blah);
Update3DTextLabelText(level[playerid],0xFFFF00AA,str);
return 1;
}


My problem is that 3DText doesn't update, it's correctly created so I can see it on someone, but it doesn't change the value.

How can I fix that?

Thank you.
Reply
#2

Please use [ code ], I don't know what's code and what's your text.
Reply
#3

At the top of gamemode:
Код:
new Text3D:level[100];
OnPlayerDisconnect:
Код:
Delete3DTextLabel(level[playerid]);
OnGamemodeInit:
Код:
SetTimer("level2", 4000, 1);
When player is logged in successfully:
Код:
format(str33, 256, "Level: %d Exp: %d/%d", something, something, something);
level[playerid] = Create3DTextLabel(str33,0xFFFF00AA,0.0,0.0,0.0,15.0,0);
Attach3DTextLabelToPlayer(level[playerid], playerid, 0.0, 0.0, -0.4);
At the bottom of script:
Код:
forward level2(playerid);
public level2(playerid)
{
something here...
}
}
format(str, 256, "Level: %d Exp: %d/%d", blah, blah, blah);
Update3DTextLabelText(level[playerid],0xFFFF00AA,str);
  return 1;
}
I assume thats what he means
Reply
#4

Quote:
Originally Posted by XxCozzaxX
At the top of gamemode:
Код:
new Text3D:level[100];
OnPlayerDisconnect:
Код:
Delete3DTextLabel(level[playerid]);
OnGamemodeInit:
Код:
SetTimer("level2", 4000, 1);
When player is logged in successfully:
Код:
format(str33, 256, "Level: %d Exp: %d/%d", something, something, something);
level[playerid] = Create3DTextLabel(str33,0xFFFF00AA,0.0,0.0,0.0,15.0,0);
Attach3DTextLabelToPlayer(level[playerid], playerid, 0.0, 0.0, -0.4);
At the bottom of script:
Код:
forward level2(playerid);
public level2(playerid)
{
something here...
}
}
format(str, 256, "Level: %d Exp: %d/%d", blah, blah, blah);
Update3DTextLabelText(level[playerid],0xFFFF00AA,str);
 return 1;
}
I assume thats what he means
Yes..
How can I update 3D Text Label ? Because Update3DTextLabelText is not working at all, it doesn't do anything with it.
Reply
#5

You have to loop through all players.

I don't know the exact code you have in there, but it should be something like this:

pawn Код:
forward level2();
public level2()
{
    for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
    {
        if(IsPlayerConnected(playerid))
        {
            format(str, 256, "Level: %d Exp: %d/%d", blah, blah, blah);
            Update3DTextLabelText(level[playerid],0xFFFF00AA,str);
        }
    }
}
Reply
#6

Quote:
Originally Posted by MadeMan
You have to loop through all players.

I don't know the exact code you have in there, but it should be something like this:

pawn Код:
forward level2();
public level2()
{
    for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
    {
        if(IsPlayerConnected(playerid))
        {
            format(str, 256, "Level: %d Exp: %d/%d", blah, blah, blah);
            Update3DTextLabelText(level[playerid],0xFFFF00AA,str);
        }
    }
}
Thank you! God bless you xd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)