SA-MP Forums Archive
Create3DTextLabel - 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)
+--- Thread: Create3DTextLabel (/showthread.php?tid=428429)



Create3DTextLabel - Blackazur - 05.04.2013

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?


Re: Create3DTextLabel - Scenario - 05.04.2013

... 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...


Re: Create3DTextLabel - L.Hudson - 05.04.2013

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


AW: Re: Create3DTextLabel - Blackazur - 05.04.2013

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.


Re: Create3DTextLabel - Scenario - 05.04.2013

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