player 3dlabel -
iBots - 15.05.2014
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:"
Re: player 3dlabel -
Smileys - 15.05.2014
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
Re: player 3dlabel -
iBots - 15.05.2014
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?
Re: player 3dlabel -
ball - 15.05.2014
Код:
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(...);
Re: player 3dlabel -
iBots - 15.05.2014
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?
Re: player 3dlabel -
ball - 15.05.2014
You have to destroy player label in OnPlayerDisconnect
Код:
Delete3DTextLabel(clicktag[playerid]);
Re: player 3dlabel -
iBots - 15.05.2014
already did but doesnt work,can you make one from the beginning for me?
Re: player 3dlabel -
ball - 15.05.2014
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.