SA-MP Forums Archive
3D Text Update - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 3D Text Update (/showthread.php?tid=135344)



3D Text Update - dawidek11 - 20.03.2010

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.


Re: 3D Text Update - 96th - 20.03.2010

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


Re: 3D Text Update - cozza123456 - 20.03.2010

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


Re: 3D Text Update - dawidek11 - 20.03.2010

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.


Re: 3D Text Update - MadeMan - 20.03.2010

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);
        }
    }
}



Re: 3D Text Update - dawidek11 - 21.03.2010

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