06.07.2015, 22:57
It's not showing because you set the coordinates wrong. You must attach it to player's current coordinates with a little boost of Z coordinate:
Anyway, doing it this way, you won't be able to delete the text when a donator disconnects. In order to fix this, you need to create a global array:
pawn Код:
new Float: posX, Float: posY, Float: posZ;
GetPlayerPos (playerid, posX, posY, posZ);
new Text3D:label = Create3DTextLabel("Donating Player", RED, posX, posY, posZ + 0.5, 40.0, 0);
Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
pawn Код:
new Text3D:donatorText[MAX_PLAYERS];
<..> when a donator connects
new Float: posX, Float: posY, Float: posZ;
GetPlayerPos (playerid, posX, posY, posZ);
donatorText [playerid] = Create3DTextLabel ("Donating Player", RED, posX, posY, posZ + 0.5, 40.0, 0);
Attach3DTextLabelToPlayer (donatorText [playerid], playerid, 0.0, 0.0, 0.7);
<...> when a donator disconnects
Delete3DTextLabel (donatorText [playerid]);