Jump to content

Gas Station With Pumps


Recommended Posts

Hi guys. Im work on fuel system. Im being this code because I want to make this easily. But I have a problem with gas station.

I did this but pumps(1686) are stays behind the gas station(10789). How can I get it forward?

My Code:

createObject(10789, 0, 0, 4.8, 0, 0, 195) 
addEventHandler("onResourceStart", resourceRoot, function() 
    for i, object in ipairs(getElementsByType("object")) do 
        if getElementModel(object) == 10789 then 
            local x, y, z = getElementPosition(object) 
            local rx, ry, rz = getElementRotation(object) 
            local rot = math.rad(rz-90) 
            local x1, x2, x3, x4 = tonumber(x-9.5*math.sin(rot)), tonumber(x-3.8*math.sin(rot)), tonumber(x+3.8*math.sin(rot)), tonumber(x+9.5*math.sin(rot)) 
            local y1, y2, y3, y4 = tonumber(y+9.5*math.cos(rot)), tonumber(y+3.8*math.cos(rot)), tonumber(y-3.8*math.cos(rot)), tonumber(y-9.5*math.cos(rot)) 
            createObject(1686, x1, y1, z-2.4, 0, 0, rz-90) 
            createObject(1686, x2, y2, z-2.4, 0, 0, rz-90) 
            createObject(1686, x3, y3, z-2.4, 0, 0, rz-90) 
            createObject(1686, x4, y4, z-2.4, 0, 0, rz-90) 


Link to comment

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...