Walid Posted May 17, 2015 Share Posted May 17, 2015 Working!Thank you very much You are welcome Link to comment
scaryface87 Posted July 13, 2015 Author Share Posted July 13, 2015 I would like to know i its possible to add multiple words in "1" line for example it will add "Hello world" on the table (so if i do /addword Hello World it will add " hello world" due fact it will only add "hello" now) Link to comment
iMr.Dawix~# Posted July 14, 2015 Share Posted July 14, 2015 I would like to know i its possible to add multiple words in "1" linefor example it will add "Hello world" on the table (so if i do /addword Hello World it will add " hello world" due fact it will only add "hello" now) try this function showits(player,cmd,...) message = table.concat({...}," ") triggerClientEvent(player,"showit",player,message) end addCommandHandler("showit",showits) Link to comment
scaryface87 Posted July 14, 2015 Author Share Posted July 14, 2015 Hello , I get this in debug if i do so cannot use "..." outside a vararg function near "..." plus ur using the wrong line to add no? Link to comment
iMr.Dawix~# Posted July 14, 2015 Share Posted July 14, 2015 function showits(player,cmd,...) local ve = {...} message = table.concat(ve," ") triggerClientEvent(player,"showit",player,message) end addCommandHandler("showit",showits) Link to comment
scaryface87 Posted July 16, 2015 Author Share Posted July 16, 2015 Not working , in debug i get bad argument #1 to pairs table expected, got string Link to comment
GTX Posted July 16, 2015 Share Posted July 16, 2015 Obviously, because you're iterating through string (which you can't). function showits(player) if isElement(player) then triggerClientEvent(player,"showit",player,Table) end end addCommandHandler("showit",showits) function addWordToGridList(Table) guiSetVisible(window1,true) for i=1, #Table do local row = guiGridListAddRow(gridlist1) guiGridListSetItemText (gridlist1, row, collumn1,tostring(Table[i]),false, false) end end addEvent("showit",true) addEventHandler("showit",root,addWordToGridList) Link to comment
iMr.Dawix~# Posted July 19, 2015 Share Posted July 19, 2015 Client: window1 = guiCreateWindow(471, 219, 200, 210, "Words in randomizer", false) guiWindowSetSizable(window1, false) gridlist1 = guiCreateGridList(16, 50, 167, 146, false, window1) local collumn1 = guiGridListAddColumn(gridlist1, "Name", 0.4) local collumn2 = guiGridListAddColumn(gridlist1, "Words", 0.9) function addWordToGridList(text) guiWindowSetSizable(window1, false) local row = guiGridListAddRow(gridlist1) guiGridListSetItemText(gridlist1, row,collumn1,getPlayerName(source),false, false) guiGridListSetItemText(gridlist1, row,collumn2,tostring(text),false, false) end addEvent("showit",true) addEventHandler("showit",root,addWordToGridList) Server: function showits(player,cmd,...) local ve = {...} if #ve > 0 then message = table.concat(ve," ") triggerClientEvent(player,"showit",player,message) end end addCommandHandler("showit",showits) 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