3DLabelTextToPlayer bug???
#1

Hi,

How do i fix this ?? When a admin goes on duty there should be an LabelText at the top of their head

Sometimes there is an Label at players then sometimes its not showing up

like this:


At this player its showing:



but at this its not:


I think theres nothing wrong with my code right?
Код:
CMD:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "This is an admin only command!");
	{
	    //if(PlayerInfo[playerid][pAdminNameSet] == 1)
	    //{
			if(PlayerInfo[playerid][pAdminDuty] == 0)
				{

					SendClientMessageEx(playerid, COLOR_YELLOW, "You are now on administrative duty! Remember to check /reports!");
					PlayerInfo[playerid][pAdminDuty] = 1;
					SetPlayerHealth(playerid, 100000);
					SetPlayerArmour(playerid, 100000);
					//SetPlayerColor(playerid, COLOR_REALRED);
					SetPlayerMarkerForPlayer(playerid,  1, ( GetPlayerColor( 1 ) & 0xFFFFFF00 ) );
					//SetPlayerSkin(playerid, 294); - Commented by Voltage
					AdminLabel[playerid] = Create3DTextLabel("{FFFF00}Admininstrator ON Duty\n{FF0000}Do not attack!",0x008080FF,30.0,40.0,50.0,40.0,0);
		  			Attach3DTextLabelToPlayer(AdminLabel[playerid], playerid, 0.0, 0.0, 0.4);
					//strcat(NormalName[playerid], GetPlayerNameEx(playerid));
					//SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
					new string[128];
					format(string, sizeof(string), "Administrator %s(ID %d) is now on Admin Duty!", GetPlayerNameEx(playerid), playerid);
					ABroadCast(COLOR_YELLOW, string, 1);
				}
				else
				{
					SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
					//SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
				 	Delete3DTextLabel(AdminLabel[playerid]);
					SetPlayerHealth(playerid, 100);
					SetPlayerArmour(playerid, 0);
					SetPlayerToTeamColor(playerid);
					//SetPlayerSkin(playerid, 299); - Commented by Voltage
					PlayerInfo[playerid][pAdminDuty] = 0;
					new string[128];
					format(string, sizeof(string), "Administrator %s(ID %d) is now Off Admin Duty! ( Leave the Admin to Roleplay )", GetPlayerNameEx(playerid), playerid);
					ABroadCast(COLOR_YELLOW, string, 1);
					//SetPlayerName(playerid, NormalName[playerid]);
				}
		//} else return SendClientMessage(playerid, COLOR_WHITE, "You don't have an admin name yet! Contact Server Owner to set your admin name!");
	}
	return 1;
}
Reply
#2

Other guy was on duty? Re-Test.
Reply
#3

It could be that you've reached the limit of objects!

Let me know if that's the case or not!
Reply
#4

Quote:
Originally Posted by Dokins
Посмотреть сообщение
It could be that you've reached the limit of objects!

Let me know if that's the case or not!
Yes, i got this message on server.log

how do i add/change the object limit??

Код:
[17:43:35] [script] 3DTEXTDRAW LIMIT: 1024 (Static, non-streamed) | 3DTEXTDRAW COUNT: 1729
[17:43:35] [script] PICKUP LIMIT: 4096 (Static, non-streamed) | PICKUP COUNT: 1480
[17:43:35] [script] OBJECT LIMIT: 1000 (Static, non-streamed) | OBJECT COUNT: 10062
Reply
#5

Yesterday, I handed you the solution.. you should use dynamic textlabels:

I'd recommend using dynamic 3d textlabels, at this situation here:
pawn Код:
AdminMode[playerid] = CreateDynamic3DTextLabel("{FFFF00}Administrator on duty!\n{FF1515}Do not Attack!", 0xF600F6FF, 0, 0, -20, 25, playerid);
Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, AdminMode[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
Using dynamic 3D textlabels..

PS: I told you yesterday about it...
Reply
#6

You can use a streamer!

I recommend incognito. You need to however use slightly different parameters.

https://sampforum.blast.hk/showthread.php?tid=102865

pawn Код:
native Text3D:CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);

It can sometimes cause issues mixing dynamic and normal ones, So I recommend using Dynamic.
Reply
#7

Quote:
Originally Posted by Stanford
Посмотреть сообщение
Yesterday, I handed you the solution.. you should use dynamic textlabels:

I'd recommend using dynamic 3d textlabels, at this situation here:
pawn Код:
AdminMode[playerid] = CreateDynamic3DTextLabel("{FFFF00}Administrator on duty!\n{FF1515}Do not Attack!", 0xF600F6FF, 0, 0, -20, 25, playerid);
Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, AdminMode[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
Using dynamic 3D textlabels..

PS: I told you yesterday about it...
So, when i add this the the limit of this object can be now unlimited?

will my problem can be solved?
Reply
#8

Yes, Streamers can effectively be unlimited, but using EXTREME high volumes can cause localised lag in servers and high object areas also the very same.

You don't need to define anything, but you can put this:

pawn Код:
#define MAX_OBJECTS (NUMBER HERE)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)