Create3DTextLabel
#1

Hello, i've have an question the question is that the 3d Text Label lag, when Players or i near it, here is the Code:

Код:
	foreach(Player,i) SetPlayerCheckpoint(i,Map[CPx],Map[CPy],Map[CPz],6.0);
	    for(new i=0;i<MAX_PLAYERS;i++)
    {
    evac[i] = Create3DTextLabel("Evacuation Point", 0xCCFF99FF,Map[CPx],Map[CPy],Map[CPz], 40.0, 0, 0);
        }
Why is that so? How to fix it?
Reply
#2

... you're making the label MAX_PLAYERS amount of times.

So, if MAX_PLAYERS is defined as 500, you're making the label 500 times...
Reply
#3

I'll tell you what I understood. The 3D text label lags whenever you or a player goes near it.
Reply
#4

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
... you're making the label MAX_PLAYERS amount of times.

So, if MAX_PLAYERS is defined as 500, you're making the label 500 times...
And how to avoid that?

Код:
new Text3D:evac[MAX_PLAYERS];
@L.Hudson Yep.
Reply
#5

You don't need a player ID parameter for that label. So, instead of this:

pawn Код:
for(new i=0;i<MAX_PLAYERS;i++)
    {
    evac[i] = Create3DTextLabel("Evacuation Point", 0xCCFF99FF,Map[CPx],Map[CPy],Map[CPz], 40.0, 0, 0);
        }
Do this:

pawn Код:
new Text3D:evac; // top of script
evac = Create3DTextLabel("Evacuation Point", 0xCCFF99FF,Map[CPx],Map[CPy],Map[CPz], 40.0, 0, 0);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)