1LoL1 Posted May 12, 2014 Share Posted May 12, 2014 Hey, how do I put these hexes away? I tried it 4 hours and did not know anyone advise? --Name statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..getPlayerName(getLocalPlayer()) ,true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["name"],"center") guiSetFont (statsLabel["name"], "default-bold-small" ) setElementData(statsLabel["name"],"identifikation","name") guiSetText(statsLabel["name"],"Name: "..getPlayerName(getLocalPlayer())) Link to comment
1LoL1 Posted May 12, 2014 Author Share Posted May 12, 2014 I tried it but somehow it does not .. :gsub("#% x% x% x% x% x% x", "") string.gsub(getPlayerName(getLocalPlayer()), "#% x% x% x% x% x% x "," ") Link to comment
-.Paradox.- Posted May 12, 2014 Share Posted May 12, 2014 getPlayerName(player):gsub ( "#%x%x%x%x%x%x", "" ) Link to comment
1LoL1 Posted May 12, 2014 Author Share Posted May 12, 2014 getPlayerName(player):gsub ( "#%x%x%x%x%x%x", "" ) Yet how many times do I have to write that this is what I have tried everything possible that if you put the entire post so it can go .. Link to comment
#RooTs Posted May 12, 2014 Share Posted May 12, 2014 local name = getPlayerName(localPlayer):gsub('#%x%x%x%x%x%x', '') statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..name ,true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["name"],"center") guiSetFont (statsLabel["name"], "default-bold-small" ) setElementData(statsLabel["name"],"identifikation","name") Link to comment
1LoL1 Posted May 13, 2014 Author Share Posted May 13, 2014 local name = getPlayerName(localPlayer):gsub('#%x%x%x%x%x%x', '') statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..name ,true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["name"],"center") guiSetFont (statsLabel["name"], "default-bold-small" ) setElementData(statsLabel["name"],"identifikation","name") But however it is again differently ... and it does not work .. Link to comment
Karuzo Posted May 13, 2014 Share Posted May 13, 2014 --Name local namenohex = string.gsub ( getPlayerName ( source ), '#%x%x%x%x%x%x', '' ) statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..namenohex ,true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["name"],"center") guiSetFont (statsLabel["name"], "default-bold-small" ) setElementData(statsLabel["name"],"identifikation","name") Link to comment
1LoL1 Posted May 13, 2014 Author Share Posted May 13, 2014 --Name local namenohex = string.gsub ( getPlayerName ( source ), '#%x%x%x%x%x%x', '' ) statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..namenohex ,true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["name"],"center") guiSetFont (statsLabel["name"], "default-bold-small" ) setElementData(statsLabel["name"],"identifikation","name") Now it does not show up there at all :(I'll give the whole post? Link to comment
TAPL Posted May 13, 2014 Share Posted May 13, 2014 Why you used source? Try with localPlayer? Link to comment
Karuzo Posted May 13, 2014 Share Posted May 13, 2014 Oh, my mistake , typed too fast. Link to comment
1LoL1 Posted May 13, 2014 Author Share Posted May 13, 2014 I used this but when I changed the name so I changed it .. local namenohex = string.gsub ( getPlayerName(getLocalPlayer()), '#%x%x%x%x%x%x', '' ) statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..namenohex ,true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["name"],"center") guiSetFont (statsLabel["name"], "default-bold-small" ) setElementData(statsLabel["name"],"identifikation","name") Link to comment
Castillo Posted May 13, 2014 Share Posted May 13, 2014 You mean that you want it to update when you change your nick? if so, you must use the onClientPlayerChangeNick event. Link to comment
1LoL1 Posted May 13, 2014 Author Share Posted May 13, 2014 You mean that you want it to update when you change your nick? if so, you must use the onClientPlayerChangeNick event. And you could not write it through out my post? thus making it difficult to even know what I do there what are you wrote ? Link to comment
Castillo Posted May 13, 2014 Share Posted May 13, 2014 There's an example of how to use that event in the wiki page: https://wiki.multitheftauto.com/wiki/onC ... ChangeNick You have to use the function guiSetText to update the name in the label. Link to comment
1LoL1 Posted May 13, 2014 Author Share Posted May 13, 2014 There's an example of how to use that event in the wiki page:https://wiki.multitheftauto.com/wiki/onC ... ChangeNick You have to use the function guiSetText to update the name in the label. So just this? AddEventHandler ("onClientPlayerChangeNick" getLocalPlayer () Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now