player 3dlabel
#1

i have something,when player connects it makes a label and attaches it to you,when you click on lmb it changes the string to +1,each time you click it changes and gets +1 clicks,the label shows how many clicks you have,but it works fine till i reach 10 clicks then i get two labels on me and it gets hard to see,how can i make it update the string to the amount of the clicks and works right?
code:
pawn Код:
clicktag[playerid] = Create3DTextLabel("Clicks ", COLOR_WHITE, 30.0, 40.0, 50.0, 40.0, 0, 0);
                Attach3DTextLabelToPlayer(clicktag[playerid], playerid, 0.0, 0.0, 0.5);
and onplayerkeystatechange:"
pawn Код:
Clicks[playerid] += 1;
Reply
#2

can you show us your entire code, because I don't see how you're showing the amount of clicks in 3d label here; seems like you only posted half of the code
Reply
#3

listen,i just made it when you click under onplayerkeystatechange it makes Clicks for you +1,and each 1 second it updates the label,but it doesnt work good,it reaches 10 clicks then the label gets bugged,how can i make a good one?
Reply
#4

Код:
clicktag[playerid] = Create3DTextLabel("Clicks ", COLOR_WHITE, 30.0, 40.0, 50.0, 40.0, 0, 0);
                Attach3DTextLabelToPlayer(clicktag[playerid], playerid, 0.0, 0.0, 0.5);
This code you should enter in OnPlayerConnect. In timer you should use Update3DTextLabelText function

Код:
new s[32];
format(s, 32, "Clicks: %d", Clicks[playerid]);
Update3DTextLabelText(...);
Reply
#5

i tried like that but when it reach 10 clicks it gets bugged,and i made onplayerdisconnect/connect to make it 0,but still when i relog it writes the same clicks i had,could you create one for me?
Reply
#6

You have to destroy player label in OnPlayerDisconnect

Код:
Delete3DTextLabel(clicktag[playerid]);
Reply
#7

already did but doesnt work,can you make one from the beginning for me?
Reply
#8

In my code i have Delete3DTextLabel used two times - in OnPlayerConnect and OnPlayerDisconnect

Код:
//OnPlayerConnect
Delete3DTextLabel(pLabel[playerid][0]);
	pLabel[playerid][0] = Create3DTextLabel(pName[playerid], 0xFFFFFFFF, 0.0, 0.0, 0.25, 12.5, -1);
	return Attach3DTextLabelToPlayer(pLabel[playerid][0], playerid, 0.0, 0.0, -0.65);

//OnPlayerDisconnect
Delete3DTextLabel(pLabel[playerid][0]);

//In some timer
Update3DTextLabelText(...);
And for me it works good - never get bugged.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)