Jump to content

Help createColRectangle


iPrestege

Recommended Posts

Posted

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 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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! :) (:

  

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You could try with this calculation:

width, height = ( x2 - x1 ), ( y2 - y1 ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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?

  

Posted

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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 
) 

  

Posted

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
ColShape = createColRectangle (-1947.08, -1796.138, 100, 100 ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Well, next time you should ask what is width and height, not how to calculate it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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) 

If I helped you, please click the like button on the right ;) Thanks!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...