Markeloff Posted December 9, 2013 Share Posted December 9, 2013 Hello, Does anyone know how to get the text inside the DxDrawText? Well, let me clarify : dxDrawText("Team : ",....) if the text is "Team : " then ... Thanks. Link to comment
Castillo Posted December 9, 2013 Share Posted December 9, 2013 Define it as a variable. Link to comment
Markeloff Posted December 9, 2013 Author Share Posted December 9, 2013 how to define it as a variable? Link to comment
Castillo Posted December 9, 2013 Share Posted December 9, 2013 local theTeam = "Team name" dxDrawText ( "Team: ".. theTeam ) Link to comment
Markeloff Posted December 9, 2013 Author Share Posted December 9, 2013 The problem is that I'm using a table. local theSpawnTable = { { "Civilian", "SF" }, { "Army", "Desert" }, { "Medic", "SF" }, } and from the table I created the dxDrawText, I'm making a spawn panel with arrows. When I press an arrow it shows the next window but it's the same one with different dx text. I couldn't find any way to check the the team if Civilian then Spawn Window will be from i=2,#theSpawnTable . function SpawnWindow() for i=1,#theSpawnTable do --I won't make it for one i=1, for all i=2 or i=3 local team = theSpawnTable[i][1] dxDrawText("Team : "..team, 648, 270, 779, 304, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) end end Link to comment
Castillo Posted December 9, 2013 Share Posted December 9, 2013 Define a global variable which will contain the selected index, then to switch the team, increase or decrease the variable. Then in the dxDrawText use the index to get the team name from the table. Link to comment
Markeloff Posted December 9, 2013 Author Share Posted December 9, 2013 Oh Thanks !! Finally not a complicated idea. 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