3DTextLabel - Attach To Player - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 3DTextLabel - Attach To Player (
/showthread.php?tid=455103)
3DTextLabel - Attach To Player -
Skimmer - 31.07.2013
Hello, i have a Donating System on my server.
Each Donators should have a 3D Text Label above their head, but they can also turn it off by using /vipsettings.
Now the problem is, I don't have any errors on the script, but for some reason the Text doesn't attach to head.
Creating the variable
pawn Код:
new Text3D:vip_text[MAX_PLAYERS];
This allows to make the text visible or unvisible. (I have a Dialog System)
pawn Код:
switch(itemid)
{
case 1:
{
if(attach_vip[playerid] == true)
{
attach_vip[playerid] = false;
Update3DTextLabelText(vip_text[playerid], 0xFFFFFFFF, " ");
}
else
{
attach_vip[playerid] = true;
Update3DTextLabelText(vip_text[playerid], COLOR_GROUP, "Donator Player");
}
}
}
This is when player connects the server and he's Donator.
pawn Код:
vip_text[playerid] = Create3DTextLabel("Donating Player", COLOR_GROUP, 0.0, 0.0, 0.0, 40.0, 0, 0);
When the player spawns.
pawn Код:
if(attach_vip[playerid] == true)
{
Attach3DTextLabelToPlayer(vip_text[playerid], playerid, 0.0, 0.0, 0.5);
}
When player disconnects.
pawn Код:
Delete3DTextLabel(vip_text[playerid]);
vip_text[playerid] = Text3D:INVALID_3DTEXT_ID;
Re: 3DTextLabel - Attach To Player -
dEcooR - 31.07.2013
try this
and btw you have not to use everywhere this Text3D:vip_text[playerid],only
vip_text[playerid]
Код:
if(attach_vip[playerid] == true)
{
attach_vip[playerid] = false;
Delete3DTextLabel(vip_text[playerid]);
vip_text[playerid] = Text3D:INVALID_3DTEXT_ID;
}
else
{
attach_vip[playerid] = true;
Update3DTextLabelText(Text3D:vip_text[playerid], COLOR_GROUP, "Donator Player");
Attach3DTextLabelToPlayer(Text3D:vip_text[playerid], playerid, 0.0, 0.0, 0.5);
}