#Paper Posted June 4, 2011 Share Posted June 4, 2011 So, i've a problem whit the Y Assix: See 1° part: When i dead the script writes the line under the chat See 2° part: When someone deads after me my dead line goes under and the new line writes in mine dead line 1° position... But this doesn't appens The 2° text goes under the chat and my dead line don't goes down: function onRender() local text = 1 local y = 200 for _,item in ipairs(players) do dxDrawColorText(item, 15, y - 16 * text, 15, y - 16 * text,tocolor(255,255,255), 0.35, "bankgothic", "left", "center",false, false, false) text = text + 1 y = y + 8 end end addEventHandler("onClientRender", getRootElement(), onRender) Link to comment
Moderators Citizen Posted June 4, 2011 Moderators Share Posted June 4, 2011 humm maybe this ?: function onRender() -- local text = 1 local y = 200 for _,item in ipairs(players) do dxDrawColorText(item, 15, 16-y, 15, 16-8,tocolor(255,255,255), 0.35, "bankgothic", "left", "center",false, false, false) -- text = text + 1 y = y + 8 end end addEventHandler("onClientRender", getRootElement(), onRender) Link to comment
#Paper Posted June 5, 2011 Author Share Posted June 5, 2011 City, ur code doesn't fix mine problem, but i made another code: local y = 200 function onTriggerAdd(pos, toIns) table.insert(players, toIns) y = y + 8 end addEvent("onAddRequest", true) addEventHandler("onAddRequest", getRootElement(), onTriggerAdd) local text = 1 function onRender() for _,item in ipairs(players) do dxDrawColorText(item, 15, y - 8 , 15, y - 8 ,tocolor(255,255,255), 0.35, "bankgothic", "left", "center", false, false, false) text = text + 1 end end addEventHandler("onClientRender", getRootElement(), onRender) Now the text goes down but all lines are in the same position... Link to comment
Moderators Citizen Posted June 5, 2011 Moderators Share Posted June 5, 2011 local y = 200 function onTriggerAdd(pos, toIns) table.insert(players, toIns) y = y + 8 end addEvent("onAddRequest", true) addEventHandler("onAddRequest", getRootElement(), onTriggerAdd) function onRender() local text = 0 for _,item in ipairs(players) do dxDrawColorText(item, 15, y-text , 15, y-text ,tocolor(255,255,255), 0.35, "bankgothic", "left", "center", false, false, false) text = text+8 end end addEventHandler("onClientRender", getRootElement(), onRender) Link to comment
Moderators Citizen Posted June 5, 2011 Moderators Share Posted June 5, 2011 No problem but some players change de size of their chatbox so maybe you can use getChatboxLayout to get the size of the chatbox's player and set it to y It just a suggestion Link to comment
#Paper Posted June 5, 2011 Author Share Posted June 5, 2011 it returns the line nums? Link to comment
Moderators Citizen Posted June 5, 2011 Moderators Share Posted June 5, 2011 Yeah, see the wiki it's in exemple: local lines = getChatboxLayout()["chat_lines"] 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