[HELP!]3DTextLabel doesn't appear when attached -
CONTROLA - 27.01.2011
Hey
Well, I've got this code:
Code:
if(strcmp(cmd, "/setepithet") == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pEpiPoints] >= 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new PlayerText3D:playertextid;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setepithet [string]");
return 1;
}
new Float:X, Float:Y, Float:Z;
format(string, sizeof(string), "%s", (result));
PlayerInfo[playerid][pEpi]=string;
GetPlayerPos( playerid, X, Y, Z );
playertextid = CreatePlayer3DTextLabel(playerid,string,0xa9c4e4FF,X,Y,Z+0.1,20.0);
PlayerInfo[playerid][pEpiPoints]-=1;
PlayerInfo[playerid][pEpiON] = 1;
return 1;
}
}
}
}
}
Everything works fine, the 3DTextLabel is created, but when I try to attach the 3DTextLabel like this:
Code:
if(strcmp(cmd, "/setepithet") == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pEpiPoints] >= 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new PlayerText3D:playertextid;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setepithet [string]");
return 1;
}
new Float:X, Float:Y, Float:Z;
format(string, sizeof(string), "%s", (result));
PlayerInfo[playerid][pEpi]=string;
GetPlayerPos( playerid, X, Y, Z );
playertextid = CreatePlayer3DTextLabel(playerid,string,0xa9c4e4FF,X,Y,Z+0.1,20.0,playerid);
PlayerInfo[playerid][pEpiPoints]-=1;
PlayerInfo[playerid][pEpiON] = 1;
return 1;
}
}
}
}
}
It doesn't work, and the 3DTextLabel doesn't even appear now.
What can I do?
Re: [HELP!]3DTextLabel doesn't appear when attached -
PeteShag - 27.01.2011
Try something like:
pawn Code:
playertextid = Create3DTextLabel(playerid,string,0xa9c4e4FF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(playertextid[playerid], playerid, 0.0, 0.0, 0.7);
Re: [HELP!]3DTextLabel doesn't appear when attached -
CONTROLA - 27.01.2011
It's the same thing. 3DTextLabel doesn't appear after it's attached. Do you know anything else I can do?
Re: [HELP!]3DTextLabel doesn't appear when attached -
iggy1 - 27.01.2011
If you look on page two of the bug reports section i have a topic there about this exact same thing no one has replied. It is a bug because not even incognitos streamer can attach objects to players.
I had this very simple code which should work. (but doesn't)
pawn Code:
new Text3D:ij_viptitles[MAX_PLAYERS];//global
new ij_hastitle[MAX_PLAYERS];// " "
COMMAND:viptitle(playerid, params[])
{
if(ij_vipdata[playerid][ij_viplogged])
{
if(isnull(params))return SendClientMessage(playerid,LRED,"ERROR: Usage /viptitle [title/name]");
else if(strlen(params) > 25)return SendClientMessage(playerid,LRED,"ERROR: That title is too long max length is 25");
else
{
SendClientMessage(playerid, GREEN, "Use /titleoff to remove your title");
if(ij_hastitle[playerid] == 1)
return Update3DTextLabelText(ij_viptitles[playerid], ORANGE, params);
else
{
new
Float:x,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
ij_viptitles[playerid] = Create3DTextLabel(params,ORANGE, x, y, z, 50.0, GetPlayerVirtualWorld(playerid), 0);
Attach3DTextLabelToPlayer(ij_viptitles[playerid], playerid, 0.0, 0.0, 0.5);//if i comment this line the 3d text is created
ij_hastitle[playerid] = 1; //at the players location. (static)
return 1;
}
}
}
else SendClientMessage(playerid,LRED,"You Don't Have Permission To Use That Command");
return 1;
}