Salut Ok, deci am codul acesta: 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;
}
}
}
}
}
Totul merge perfect. 3DTextLabel-ul apare, dar ramane in locul X,Y,Z, adica nu este atasat de jucator.
Deci, am incercat sa fac asta:
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[b],playerid[/b]);
PlayerInfo[playerid][pEpiPoints]-=1;
PlayerInfo[playerid][pEpiON] = 1;
return 1;
}
}
}
}
} Textul nu este atasat de jucator, iar acesta nici macar nu mai apare acum. Ce pot face?