3DText variable bugged
#1

Let's do this:

pawn Код:
new Text3D: label[MAX_PLAYERS];

// in a command
label[playerid] = Create3DTextLabel(ReturnName(playerid),COLOR_WHITE,pos[0],pos[1],pos[2]-0.3,30.0,0);
// ok, Text3d is avaible
// after this line, let's do this:
printf("%d",label[playerid]);
Ok, i get the warning Tag Mismatch, and in console i get val 0.

SO !?
Reply
#2

Text3D is not just an integer value, that contains the id of the label, so you cant display it using the normal string formats (printf, format, ... just accept the native pawn variable types)
If you want to display the id, you'd have to count the label ids yourself, by increasing a variable on each labelcreation.
Reply
#3

@Mauzen: Create3DTextLabel DOES returns the ID of that textdraw

pawn Код:
label[playerid] = Create3DTextLabel(ReturnName(playerid),COLOR_WHITE,pos[0],pos[1],pos[2]-0.3,30.0,0);
That '30' is the virtual world of the textdraw, not range or something. 30.0 is a float value, I suggest you either remove the '.0' or set it to 0.
Reply
#4

Ok, but if i create a 3dtextlabel, and i put it in a variable, and i want to delete it after 5 seconds with the SetTimerEx, will be that possible ?

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
@Mauzen: Create3DTextLabel DOES returns the ID of that textdraw

pawn Код:
label[playerid] = Create3DTextLabel(ReturnName(playerid),COLOR_WHITE,pos[0],pos[1],pos[2]-0.3,30.0,0);
That '30' is the virtual world of the textdraw, not range or something. 30.0 is a float value, I suggest you either remove the '.0' or set it to 0.
Hiddos, are you so sure ?

Parameters:
(text[], color, Float:X, Float:Y, Float:Z, Float: DrawDistance, virtualworld, testLOS)

Create3DTextLabel(ReturnName(playerid),COLOR_WHITE ,pos[0],pos[1],pos[2]-0.3,30.0,0);

text[] = ReturnName(playerid)
color = COLOR_WHITE
Float:X = pos[0]
Float:Y = pos[1]
Float:Z = pos[2]-0.3
Float: DrawDistance = 30.0
virtualworld = 0
testLOS = it's aleardy setted to 0
Reply
#5

:O I failed.

Can you show use the ReturnName function?
Reply
#6

don't worry, the problem doesn't comes from here

pawn Код:
ReturnName(playerid)
{
    new str[MAX_PLAYER_NAME];
    GetPlayerName(playerid,str,sizeof(str));
    return str;
}
Reply
#7

so, nobody can help me ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)