iPrestege Posted January 15, 2013 Share Posted January 15, 2013 (edited) Hello, how can I calculate the area's Height and width? Edited January 15, 2013 by Guest Link to comment
Castillo Posted January 15, 2013 Share Posted January 15, 2013 There's no need for a server side script. addEventHandler ( "onClientRender", getRootElement(), function ( ) if guiGetVisible ( GUIEditor.label[9] ) then local team = getPlayerTeam ( localPlayer ) local teamName = ( team and getTeamName ( team ) or "" ) guiSetText ( GUIEditor.label[9], "Team: " .. teamName ) end end ) Link to comment
iPrestege Posted January 15, 2013 Author Share Posted January 15, 2013 There's no need for a server side script. addEventHandler ( "onClientRender", getRootElement(), function ( ) if guiGetVisible ( GUIEditor.label[9] ) then local team = getPlayerTeam ( localPlayer ) local teamName = ( team and getTeamName ( team ) or "" ) guiSetText ( GUIEditor.label[9], "Team: " .. teamName ) end end ) thanks it works good now! (: Link to comment
iPrestege Posted January 15, 2013 Author Share Posted January 15, 2013 Hello, how can I calculate the area's Height and width? Link to comment
Castillo Posted January 15, 2013 Share Posted January 15, 2013 You could try with this calculation: width, height = ( x2 - x1 ), ( y2 - y1 ) Link to comment
iPrestege Posted January 15, 2013 Author Share Posted January 15, 2013 You could try with this calculation: width, height = ( x2 - x1 ), ( y2 - y1 ) What does this mean?Can you explain more? I did not understand what you mean? Link to comment
Castillo Posted January 15, 2013 Share Posted January 15, 2013 Well, if you want to make a script which calculates the width and height from two pair of positions ( x and y ), you can try that math calculation. Link to comment
iPrestege Posted January 15, 2013 Author Share Posted January 15, 2013 Well, if you want to make a script which calculates the width and height from two pair of positions ( x and y ), you can try that math calculation. width, height = ( x2 - x1 ), ( y2 - y1 ) ColShape = createColRectangle (-1947.08, -1796.138, width, height ) addEventHandler( "onClientColShapeHit", ColShape, function ( thePlayer ) if ( thePlayer == localPlayer ) then bindKey ( "F1", "down", open ) end end ) addEventHandler( "onClientColShapeLeave", ColShape, function ( thePlayer ) if ( thePlayer == localPlayer ) then unbindKey ( "F1", "down", open ) end end ) Link to comment
Castillo Posted January 15, 2013 Share Posted January 15, 2013 I guess you don't want to do what I said, so, you just set the height and width to what you want, until it fits what you need. Link to comment
iPrestege Posted January 15, 2013 Author Share Posted January 15, 2013 I do not understand that I wanted to do Can you put an example? Link to comment
Castillo Posted January 15, 2013 Share Posted January 15, 2013 ColShape = createColRectangle (-1947.08, -1796.138, 100, 100 ) Link to comment
iPrestege Posted January 15, 2013 Author Share Posted January 15, 2013 ColShape = createColRectangle (-1947.08, -1796.138, 100, 100 ) Thank you ,you did not understand what I mean! Link to comment
Castillo Posted January 15, 2013 Share Posted January 15, 2013 Well, next time you should ask what is width and height, not how to calculate it. Link to comment
iPrestege Posted January 15, 2013 Author Share Posted January 15, 2013 Well, next time you should ask what is width and height, not how to calculate it. I know height and width! But how do I calculate it?but thanks . Link to comment
myonlake Posted January 16, 2013 Share Posted January 16, 2013 What do you even want to calculate? There's nothing to calculate (unless you want the area, circuit or volume; which are taught in normal schools; simple put, Pythagorean theorem). createColRectangle(x, y, width, height) Link to comment
iPrestege Posted January 16, 2013 Author Share Posted January 16, 2013 What do you even want to calculate? There's nothing to calculate (unless you want the area, circuit or volume; which are taught in normal schools; simple put, Pythagorean theorem). createColRectangle(x, y, width, height) Thanks! 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