SA-MP Forums Archive
3D Text Label help! - 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: 3D Text Label help! (/showthread.php?tid=445618)



3D Text Label help! - JimmyCh - 22.06.2013

Hello everyone,

I have started a gamemode recently, but I'm having a small problem with the 3D Text.
If you /switchteam it will keep the previous 3D text although I have tried Update3DTextLabelText and also Delete3DTextLabel on player death.

OnPlayerSpawn I have this:

PHP код:
public OnPlayerSpawn(playerid)
{
     
SetPlayerVirtualWorld(playerid0);
    switch( 
GetPlayerTeamplayerid ) )
    {
        case 
TEAM_ONE:
        {
            
            
SetPlayerArmour(playerid99.0);
            
SendClientMessageplayeridTEAM_RED_COLOR"You are now playing in the Red Team." );
            
label7[playerid] = Create3DTextLabel("RED TEAM PLAYER",TEAM_RED_COLOR30.040.050.040.00);
            
Attach3DTextLabelToPlayer(label7[playerid], playerid0.00.00.4);
             }
             
        case 
TEAM_TWO:
        {
            
              
SetPlayerArmour(playerid99.0);
              
SendClientMessageplayeridTEAM_BLUE_COLOR"You are now playing in the Blue Team." );
              
label7[playerid] = Create3DTextLabel("BLUE TEAM PLAYER",TEAM_BLUE_COLOR30.040.050.040.00);
              
Attach3DTextLabelToPlayer(label7[playerid], playerid0.00.00.4);
        }
        case 
TEAM_THREE:
         {
        
              
SetPlayerArmour(playerid99.0);
              
SendClientMessageplayeridTEAM_GREEN_COLOR"You are now playing in the Green Team." );
              
label7[playerid] = Create3DTextLabel("GREEN TEAM PLAYER",TEAM_GREEN_COLOR30.040.0,50.0,40.00);
              
Attach3DTextLabelToPlayer(label7[playerid], playerid0.00.00.4);
        }
        
    }
    return 
true;

How can I make it that if you /switchteam it will delete the previous text?
Would be great if someone helps me


Re: 3D Text Label help! - SMW - 22.06.2013

use DeletePlayer3DTextLabel or UpdatePlayer3DTextLabelText instead..


Re: 3D Text Label help! - JimmyCh - 22.06.2013

I said I tried both, it compiled perfectly but in-game it still showed 2 3DTexts ... So it didn't actually delete it..


Re: 3D Text Label help! - SMW - 22.06.2013

Update3DTextLabelText and UpdatePlayer3DTextLabelText are different
check it again


Re: 3D Text Label help! - JimmyCh - 22.06.2013

So I should use UpdatePlayer3DTextLabelText instead of Update3DTextLabelText?
I tried numerous stuff..
If possible, could you give me the code for it? And tell me where exactly I should put it(OnPlayerDeath, etc..).

Sorry if this was supposed to be easy, I'm still a new scripter


Re: 3D Text Label help! - SMW - 22.06.2013

give me you /switchteam code, i'll modd for you..


Re: 3D Text Label help! - JimmyCh - 22.06.2013

It's just a simple:

PHP код:
CMD:switchteam(playeridparams[])
{
ForceClassSelection(playerid);
SendClientMessage(playeridCOLOR_AQUA"Choose your team after next death!");
return 
1;




Re: 3D Text Label help! - JimmyCh - 23.06.2013

I fixed it, nevermind.


Re: 3D Text Label help! - Coz - 20.07.2013

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
I fixed it, nevermind.
do you mind actually stating how you fixed it? with an example of the code? Because i'm having the same issue trying to remove the 3dtext when you enter a vehicle. Right now the 3dtext is attached to all the vehicles and i'm tired of looking at it when im driving