Hallo Leute,
ich hab ein bisschen rum experimentiert und das rausbekommen.
public WantedShow(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsACop(i))
{
if(LabelCreated[playerid] == 0 && WantedLevel[playerid] >= 1)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
format(String,sizeof(String),"Wanteds: %d",WantedLevel[playerid]);
WantedLabel[playerid] = CreatePlayer3DTextLabel(i,String,COLOR_RED,X,Y,Z,50.0);
Attach3DTextLabelToPlayer(WantedLabel[playerid],playerid, 0.0, 0.0, 0.7);
LabelCreated[playerid] = 1;
}
if(LabelCreated[playerid] == 1 && WantedLevel[playerid] >= 1)
{
format(String,sizeof(String),"Wanteds: %d",WantedLevel[playerid]);
UpdatePlayer3DTextLabelText(i, WantedLabel[playerid], COLOR_RED,String);
}
if(LabelCreated[playerid] == 1 && WantedLevel[playerid] == 0)
{
DeletePlayer3DTextLabel(playerid, WantedLabel[playerid]);
LabelCreated[playerid] = 0;
}
}
}
return 1;
}
Das ganze sieht dann so aus.
Nun möchte ich aber das das WantedLabel über dem Spieler attacht das macht er aber nicht warum.
Hoffe jemand kann helfen
MFG
Nov