TheIceman1 Posted March 16, 2013 Posted March 16, 2013 How i can put all clans(data "clan") to grid list?
Renkon Posted March 16, 2013 Posted March 16, 2013 Check on the forum for a example to add all the players in the gridList Just replace that example with some function where you get all the clans, add it to a table, and done with ipairs(table)
TheIceman1 Posted March 16, 2013 Author Posted March 16, 2013 (edited) Check on the forum for a example to add all the players in the gridListJust replace that example with some function where you get all the clans, add it to a table, and done with ipairs(table) This doesnt work.No errors function setclans () local clan = getElementData ( localPlayer, "clan" ) for _, playerclan in ipairs (clan) do local rowc = guiGridListAddRow ( GUIEditor_Grid[3] ) guiGridListSetItemText ( GUIEditor_Grid[4], rowc, GUIEditor_Column[5], playerclan, false, false ) end end addCommandHandler ( "clans", setclans ) Edited March 16, 2013 by Guest
Castillo Posted March 16, 2013 Posted March 16, 2013 for _, playerclan in ipairs (clan) do "clan" is a table?
Castillo Posted March 16, 2013 Posted March 16, 2013 Are you sure about that? show us where do you set the "clan" element data.
TheIceman1 Posted March 16, 2013 Author Posted March 16, 2013 Here: function createclan() local clan = guiGetText ( GUIEditor_Edit[1] ) setElementData ( localPlayer, "clan", clan ) triggerServerEvent ( "createclan",localPlayer) exports ["guimessages"] : outputClient ( "You create "..clan.." clan!", 255, 255, 0 ) end end addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], createclan )
Castillo Posted March 16, 2013 Posted March 16, 2013 That's not a table, is a string. You are trying to get all clans that are currently playing on the server?
TheIceman1 Posted March 16, 2013 Author Posted March 16, 2013 No,i trying to put all made clans on grid list.
TheIceman1 Posted March 16, 2013 Author Posted March 16, 2013 function createclan() setAccountData ( acc, "Clan", getElementData ( source, "clan" ) ) end addEvent ( "createclan", true ) addEventHandler ( "createclan", root, createclan )
Castillo Posted March 16, 2013 Posted March 16, 2013 That's a problem, since you'll have to loop all accounts to get their clan data, then add them, and avoid adding duplicates.
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