[HELP] Attach And 3DTextLabel
#1

Hi Everybody
when i compiler my gamemode, i get a warning :
pawn Код:
E:\...\gm.pwn(7548) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
And line 7548:
pawn Код:
Attach3DTextLabelToPlayer(MyLabel, playerid, 0.0, 0.0, 0.4);
This codes from a whisper command :
pawn Код:
dcmd_w(playerid,params[])
{
    new string[128];
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /W (Message)");
        return 1;
    }
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10)
        {
            MyLabel = CreatePlayer3DTextLabel(playerid,params,COLOR_WHITE,0.0,0.0,0.0,40.0);
            Attach3DTextLabelToPlayer(MyLabel, playerid, 0.0, 0.0, 0.4);
            return 1;
        }
    }
    return 1;
}
Reply
#2

Does MyLabel have tag Text3D?
Код:
new Text3D:MyLabel;
Reply
#3

Quote:
Originally Posted by dominik523
Посмотреть сообщение
Does MyLabel have tag Text3D?
Код:
new Text3D:MyLabel;
No :
pawn Код:
new PlayerText3D:MyLabel;
Reply
#4

Not sure if it will work but try that :\

PHP код:
dcmd_w(playerid,params[])
{
    new 
string[128];
    if(!
strlen(params))
    {
        
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /W (Message)");
        return 
1;
    }
    for(new 
i=0;i<MAX_PLAYERS;i++)
    {
        if(
IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10)
        {
            
MyLabel CreatePlayer3DTextLabel(playerid,params,COLOR_WHITE,0.0,0.0,0.0);
            
Attach3DTextLabelToPlayer(MyLabelplayerid0.00.00.4);
            return 
1;
        }
    }
    return 
1;

Because i had similar problem before.
Reply
#5

Stuun:
not work. the warning is from line 7548
when i try your code, i get warn form line 7547 too.
Reply
#6

nvm. fail
Reply
#7

Try This:

pawn Код:
dcmd_w(playerid,params[])
{
    new string[128];
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /W (Message)");
        return 1;
    }
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10)
        {
            MyLabel = CreatePlayer3DTextLabel(playerid,params,COLOR_WHITE,0.0,0.0,0.0,40.0,0);
            Attach3DTextLabelToPlayer(MyLabel, playerid, 0.0, 0.0, 0.4);
            return 1;
        }
    }
    return 1;
}

your problem is "CreatePlayer3DTextLabel" Parameters.

pawn Код:
CreatePlayer3DTextLabel(playerid, text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, attachedplayer, attachedvehicle, testLOS)
you forgot to add "testLOS"
Reply
#8

EDIT:
Код:
CreatePlayer3DTextLabel(playerid, text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, attachedplayer, attachedvehicle, testLOS)

playerid	The player which should see the newly created 3DText Label.
text[]	The text to display.
color	The text color
x	X Coordinate (or offset if attached)
y	Y Coordinate (or offset if attached)
z	Z Coordinate (or offset if attached)
DrawDistance	The distance where you are able to see the 3D Text Label
attachedplayer	The player you want to attach the 3D Text Label to. (None: INVALID_PLAYER_ID)
attachedvehicle	The vehicle you want to attach the 3D Text Label to. (None: INVALID_VEHICLE_ID)
testLOS	0/1 Test the line-of-sight so this text can't be seen through walls
Attach3DTextLabelToPlayer used for global 3D texts, there's no such function for player 3dtext
Reply
#9

Friends,
the warn is from attach not create3dtext !
Reply
#10

Quote:
Originally Posted by M0HAMMAD
Посмотреть сообщение
Friends,
the warn is from attach not create3dtext !
Yeah, be cause you can't use Attach3DTextLabelToPlayer with PlayerText3D ... read again...
so you don't even need that function , Just put the attached id in the "CreatePlayer3DTextLabel" , read it's format again please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)