27.01.2011, 06:42
Hey
Well, I've got this code:
Everything works fine, the 3DTextLabel is created, but when I try to attach the 3DTextLabel like this:
It doesn't work, and the 3DTextLabel doesn't even appear now.
What can I do?
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;
}
}
}
}
}
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;
}
}
}
}
}
What can I do?

