3DText variable bugged -
MJ! - 28.08.2010
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 !?
Re: 3DText variable bugged -
Mauzen - 28.08.2010
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.
Re: 3DText variable bugged -
Hiddos - 28.08.2010
@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.
Re: 3DText variable bugged -
MJ! - 28.08.2010
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
Re: 3DText variable bugged -
Hiddos - 28.08.2010
:O I failed.
Can you show use the ReturnName function?
Re: 3DText variable bugged -
MJ! - 28.08.2010
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;
}
Re: 3DText variable bugged -
MJ! - 28.08.2010
so, nobody can help me ?