VIP 3D Text Label
#1

Hello, how can i replace the chat bubble with a 3d text label without that it get messed up, so that not other players get the label if i log off etc?

Код:
if(pInfo[i][pVipLevel] >= 1)
		{
             SetPlayerChatBubble(i,"VIP", COLOR_YELLOW, 100.0, 10000);
        }
Reply
#2

anyone?
Reply
#3

pawn Код:
if(pInfo[i][pVipLevel] >= 1)
{
    VIPLabel[playerid] = 1; //add new VIPLabel[MAX_PLAYERS]; near the other news..
    format(string, sizeof(string), "VIP");
    VIPLabel[playerid] = Create3DTextLabel(string, COLOR_VIP, 0, 0, -20, 25, -1, 1);
    Attach3DTextLabelToPlayer(VIPLabel[playerid], playerid, 0, 0, 0.25);
}
Reply
#4

And where should i place it to delete it, so that when i log off no other players have it?
Reply
#5

Quote:
Originally Posted by Nurgle4
Посмотреть сообщение
pawn Код:
if(pInfo[i][pVipLevel] >= 1)
{
    VIPLabel[playerid] = 1; //add new VIPLabel[MAX_PLAYERS]; near the other news..
    format(string, sizeof(string), "VIP");
    VIPLabel[playerid] = Create3DTextLabel(string, COLOR_VIP, 0, 0, -20, 25, -1, 1);
    Attach3DTextLabelToPlayer(VIPLabel[playerid], playerid, 0, 0, 0.25);
}
Warnings about tag mismatch.

pawn Код:
// global:
new
    Text3D: VIPLabel[MAX_PLAYERS];

// OnPlayerConnect:
VIPLabel[playerid] = Text3D: INVALID_3DTEXT_ID;

// OnPlayerDisconnect:
Delete3DTextLabel(VIPLabel[playerid]);
   
// after logging:
if(pInfo[i][pVipLevel] >= 1 && VIPLabel[playerid] != Text3D: INVALID_3DTEXT_ID) // prevent from get spammed with 3d labels
{
    VIPLabel[playerid] = Create3DTextLabel("VIP", COLOR_VIP, 0, 0, -20, 25, -1, 1);
    Attach3DTextLabelToPlayer(VIPLabel[playerid], playerid, 0, 0, 0.25);
}
Reply
#6

global thingy
pawn Код:
new Text3D: VIP[MAX_PLAYERS] = {Text3D: INVALID_3DTEXT_ID, ...};
And Add this under OnPlayerConnect or somewhere below it.
pawn Код:
VIP[playerid] = Text3D: INVALID_3DTEXT_ID;
Add this under OnPlayerDisconnect
pawn Код:
Delete3DTextLabel(VIP[playerid]);
and
pawn Код:
if(pInfo[i][pVipLevel] >= 1)
{
    VIPLabel[playerid] = 1; //add new VIPLabel[MAX_PLAYERS]; near the other news..
    format(string, sizeof(string), "VIP");
    VIP[playerid] = Create3DTextLabel(string, COLOR_VIP, 0, 0, -20, 25, -1, 1);
    Attach3DTextLabelToPlayer(VIP[playerid], playerid, 0, 0, 0.25);
}
This may work, Try it.

EDIT : He made it first xd
Reply
#7

yea add OnPlayerDisconnect:
pawn Код:
Delete3DTextLabel(VIPLabel[playerid]);
and OnPlayerConnect
pawn Код:
VIPLabel[playerid] = Text3D: INVALID_3DTEXT_ID;
and:

pawn Код:
new Text3D: VIPLabel[MAX_PLAYERS];
i have missed to add these...because i was in hurry
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)