Create3DTextLabel, +REP
#1

actually i'm trying to make a deadbody system it works perfect except..

The Object spawn correctly, but the 3DTextLabel doesn't show i have to Hold and drop it to see the deadbody belongs to.. also it doesn't show the name of the body it shows "SPACE" here's the codes when creating the body , and moving the body

Код:
forward ProcessDeath(playerid);
public ProcessDeath(playerid)
{
	 new str[256];
	 for(new i = 1; i < MAX_BODYS; i++)
     {
		 if(BodyInfo[i][cId] == 0)
		 {
			 format(str,sizeof(str),BodyInfo[cDescription],"%s", PlayerName(playerid));
			 
			 BodyInfo[i][cId] = i;
			 BodyInfo[i][cPos][0] = PlayerInfo[playerid][pDeathPos][0];
			 BodyInfo[i][cPos][1] = PlayerInfo[playerid][pDeathPos][1];
			 BodyInfo[i][cPos][2] = PlayerInfo[playerid][pDeathPos][2]-0.9;
			 BodyInfo[i][cInterior] = PlayerInfo[playerid][pDeathInt];


			 BodyInfo[i][cObject][0] = CreateDynamicObject(2907, BodyInfo[i][cPos][0],BodyInfo[i][cPos][1],BodyInfo[i][cPos][2], 0, 0, 274);
             BodyInfo[i][cObject][1] = CreateDynamicObject(2905, BodyInfo[i][cPos][0]+0.85376, BodyInfo[i][cPos][1]+0.161621, BodyInfo[i][cPos][2]-0.01857662, 0, 26, 278);
             BodyInfo[i][cObject][2] = CreateDynamicObject(2905, BodyInfo[i][cPos][0]+0.739746, BodyInfo[i][cPos][1]-0.158935, BodyInfo[i][cPos][2]+0.006423, 356.68469238281, 145.93511962891, 263.75891113281);
             BodyInfo[i][cObject][3] = CreateDynamicObject(2906, BodyInfo[i][cPos][0]-0.081787, BodyInfo[i][cPos][1]+0.239991, BodyInfo[i][cPos][2]-0.03601265, 359.30590820313, 273.93939208984, 298.02392578125);
             BodyInfo[i][cObject][4] = CreateDynamicObject(2906, BodyInfo[i][cPos][0]-0.024414, BodyInfo[i][cPos][1]-0.30957, BodyInfo[i][cPos][2]-0.03601265, 359.01071166992, 339.99688720703, 242.68936157227);
             
             nbCorps++;

             BodyInfo[i][cDesc] = Create3DTextLabel(str, 0xFF0000FF,BodyInfo[i][cPos][0],BodyInfo[i][cPos][1],BodyInfo[i][cPos][2]+0.5,8.0,0,1);

			 return 1;
		 }
	 }
	 return 1;
}
Код:
forward StopCarry(playerid);
public StopCarry(playerid)
{
	new Float:Pos[3], string[128], str[256];
	GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);

    BodyInfo[CarryBody[playerid]][cPos][0] = Pos[0];
	BodyInfo[CarryBody[playerid]][cPos][1] = Pos[1];
    BodyInfo[CarryBody[playerid]][cPos][2] = Pos[2]-0.9;

    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);

    format(str,sizeof(str), "%s", BodyInfo[CarryBody[playerid]][cDescription]);
    
    BodyInfo[CarryBody[playerid]][cObject][0] = CreateDynamicObject(2907, BodyInfo[CarryBody[playerid]][cPos][0],BodyInfo[CarryBody[playerid]][cPos][1],BodyInfo[CarryBody[playerid]][cPos][2], 0, 0, 274);
    BodyInfo[CarryBody[playerid]][cObject][1] = CreateDynamicObject(2905, BodyInfo[CarryBody[playerid]][cPos][0]+0.85376, BodyInfo[CarryBody[playerid]][cPos][1]+0.161621, BodyInfo[CarryBody[playerid]][cPos][2]-0.01857662, 0, 26, 278);
    BodyInfo[CarryBody[playerid]][cObject][2] = CreateDynamicObject(2905, BodyInfo[CarryBody[playerid]][cPos][0]+0.739746, BodyInfo[CarryBody[playerid]][cPos][1]-0.158935, BodyInfo[CarryBody[playerid]][cPos][2]+0.006423, 356.68469238281, 145.93511962891, 263.75891113281);
    BodyInfo[CarryBody[playerid]][cObject][3] = CreateDynamicObject(2906, BodyInfo[CarryBody[playerid]][cPos][0]-0.081787, BodyInfo[CarryBody[playerid]][cPos][1]+0.239991, BodyInfo[CarryBody[playerid]][cPos][2]-0.03601265, 359.30590820313, 273.93939208984, 298.02392578125);
    BodyInfo[CarryBody[playerid]][cObject][4] = CreateDynamicObject(2906, BodyInfo[CarryBody[playerid]][cPos][0]-0.024414, BodyInfo[CarryBody[playerid]][cPos][1]-0.30957, BodyInfo[CarryBody[playerid]][cPos][2]-0.03601265, 359.01071166992, 339.99688720703, 242.68936157227);

	format(str, sizeof(str), "This body belogns to\n{00FF6E} %s", BodyInfo[CarryBody[playerid]][cDescription]);
	BodyInfo[CarryBody[playerid]][cDesc] = Create3DTextLabel(str, 0xFF0000FF,BodyInfo[CarryBody[playerid]][cPos][0],BodyInfo[CarryBody[playerid]][cPos][1],BodyInfo[CarryBody[playerid]][cPos][2]+0.5,8.0,0,1);
	
	RemovePlayerAttachedObject(playerid, 9);
    CarryBody[playerid] = 0;
    GText(playerid, "~g~You've released the body", 4000,1);

    ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Crouch_Out", 2.0, 0, 0, 0, 0, 0);

    format(string, sizeof(string), "* %s lies a body on the ground.", PlayerName(playerid));
	ProxDetector(30.0, playerid, string, COLOR_ACCIONME,COLOR_ACCIONME,COLOR_ACCIONME,COLOR_ACCIONME,COLOR_ACCIONME);
    return 1;
}
What's wrong with the 3DTextLabel
Reply
#2

try using dynamic labels, sa:mp only allows up to 1000 otherwise. I had the same problem a while back
Reply
#3

the BodyInfo

cDesc must be Text3D:cDesc
Reply
#4

Azula it is Text3D, i've tried Using Dynamic3D but it doesn't work after moving it
Reply
#5

destroy it

PHP код:
 for(new 1MAX_BODYSi++)
     {
        
DestroyDynamic3DTextLabel(BodyInfo[i][cDesc] );
        
     } 
Reply
#6

Thank you Azula <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)