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(playerid, 0);
switch( GetPlayerTeam( playerid ) )
{
case TEAM_ONE:
{
SetPlayerArmour(playerid, 99.0);
SendClientMessage( playerid, TEAM_RED_COLOR, "You are now playing in the Red Team." );
label7[playerid] = Create3DTextLabel("RED TEAM PLAYER",TEAM_RED_COLOR, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label7[playerid], playerid, 0.0, 0.0, 0.4);
}
case TEAM_TWO:
{
SetPlayerArmour(playerid, 99.0);
SendClientMessage( playerid, TEAM_BLUE_COLOR, "You are now playing in the Blue Team." );
label7[playerid] = Create3DTextLabel("BLUE TEAM PLAYER",TEAM_BLUE_COLOR, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label7[playerid], playerid, 0.0, 0.0, 0.4);
}
case TEAM_THREE:
{
SetPlayerArmour(playerid, 99.0);
SendClientMessage( playerid, TEAM_GREEN_COLOR, "You are now playing in the Green Team." );
label7[playerid] = Create3DTextLabel("GREEN TEAM PLAYER",TEAM_GREEN_COLOR, 30.0, 40.0,50.0,40.0, 0);
Attach3DTextLabelToPlayer(label7[playerid], playerid, 0.0, 0.0, 0.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(playerid, params[])
{
ForceClassSelection(playerid);
SendClientMessage(playerid, COLOR_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