Hiding a 3d Text label - 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: Hiding a 3d Text label (
/showthread.php?tid=452260)
Hiding a 3d Text label -
Coz - 20.07.2013
Ok, so I'm trying to hide the 3d textlabel that is attached to a vehicle when a player enters it.. right now it just stays on the vehicle.. I keep getting an error when I compile -- error 017: undefined symbol "carid"
Below is the code that attaches the 3d text label \
Код:
{
format(Str, sizeof(Str), "%s\nOwner: %s", GetVehicleFriendlyName(carid2),vehOwnedBy);
PVInfo[carid][vpVehicleText] = Create3DTextLabel(Str, 0xFF8400FF, vehX, vehY, vehZ, 50.0, 0, 1);
}
below is the code to hide the text label
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) // Player entered a vehicle as a driver or passenger
{
TextDrawHideForAll(PVInfo[carid][vpVehicleText]);
}
Re: Hiding a 3d Text label -
SuperViper - 20.07.2013
Text labels and text draws are completely different. The only way you can hide a text label is by either deleting it, making the text blank, or giving the color 0 alpha.
Re: Hiding a 3d Text label -
Coz - 20.07.2013
ohhh ok because this is my new code i just changed, and now its giving me a warning when I compile "warning 213: tag mismatch"
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) // Player entered a vehicle as a driver or passenger
{
TextDrawShowForAll(vpVehicleText);
}
that would explain the warning. So I would need to change that function to "delete3dtextlabel"?
Re: Hiding a 3d Text label -
Vampr - 20.07.2013
Good idea, make the text completely transparent
Re: Hiding a 3d Text label -
Coz - 20.07.2013
Quote:
Originally Posted by SuperViper
Text labels and text draws are completely different. The only way you can hide a text label is by either deleting it, making the text blank, or giving the color 0 alpha.
|
ok here is the new onpublicstatechange line
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) // Player entered a vehicle as a driver or passenger
{
Update3DTextLabelText(vpVehicleText, 0xFF840000, "The High Life");
}
Now i'm getting a warning message on compile "warning 213: tag mismatch" again.. I'm not sure what i'm doing wrong here