manve1 Posted November 18, 2012 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 ) Looking for tutorials or information? check out: www.simpleask.co.uk
Guest Guest4401 Posted November 18, 2012 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 ).
manve1 Posted November 18, 2012 Author Posted November 18, 2012 any way fixed? Looking for tutorials or information? check out: www.simpleask.co.uk
Kenix Posted November 18, 2012 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) http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
manve1 Posted November 18, 2012 Author Posted November 18, 2012 Didn't work Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted November 18, 2012 Posted November 18, 2012 Any error? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted November 18, 2012 Author Posted November 18, 2012 nope Looking for tutorials or information? check out: www.simpleask.co.uk
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