3D Text Label help!
#1

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
Reply
#2

use DeletePlayer3DTextLabel or UpdatePlayer3DTextLabelText instead..
Reply
#3

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

Update3DTextLabelText and UpdatePlayer3DTextLabelText are different
check it again
Reply
#5

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
Reply
#6

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

It's just a simple:

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

Reply
#8

I fixed it, nevermind.
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)