manve1 Posted November 18, 2012 Share Posted November 18, 2012 I have a problem, when i change my name, it doesn't update the gridlist function updateList(old, new) if eventName == "onClientPlayerJoin" then local i = guiGridListAddRow(aGrid) guiGridListSetItemText(aGrid, i, aColumn, getPlayerName(source):gsub("#%x%x%x%x%x%x", ""), false, false) elseif eventName == "onClientPlayerQuit" then for i=0, guiGridListGetRowCount(aGrid) do if guiGridListGetItemText(aGrid, i, aColumn) == getPlayerName(source):gsub("#%x%x%x%x%x%x", "") then guiGridListRemoveRow(aGrid, i) end end elseif eventName == "onClientPlayerChangeNick" then for i=0, guiGridListGetRowCount(aGrid) do if guiGridListGetItemText(aGrid, i, aColumn) == old then guiGridListSetItemText(aGrid, i, aColumn, new, false, false) end end end end addEventHandler("onClientPlayerJoin", root, updateList) addEventHandler("onClientPlayerQuit", root, updateList) addEventHandler("onClientPlayerChangeNick", root, updateList) P.S. I didn't make this, i had help from one of members from community ( can't remember who ) Link to comment
Guest Guest4401 Posted November 18, 2012 Share Posted November 18, 2012 I guess line 13 is the problem. Maybe you have colorcodes in your name and you check if your colorcoded matches your name without colorcodes ( which isn't true ). Link to comment
Kenix Posted November 18, 2012 Share Posted November 18, 2012 Replace( 13 ) if guiGridListGetItemText(aGrid, i, aColumn) == old then With if guiGridListGetItemText(aGrid, i, aColumn) == old:gsub("#%x%x%x%x%x%x", "") then And replace( 14 line ) guiGridListSetItemText(aGrid, i, aColumn, new, false, false) with guiGridListSetItemText(aGrid, i, aColumn, new:gsub("#%x%x%x%x%x%x", ""), false, false) 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