Jump to content

Garage script help!!


Tibix99

Recommended Posts

So i create a garage script:

 

function addGarage(thePlayer, commandName, tipus)
    if (getElementData) >= 6 then
        
        x,y,z = getElementPosition(thePlayer)
        local tipus = tonumber(tipus)
        
        if type == 1 then
            osszeg = 10000
            intid = 70
            ix, iy, iz = 615.12976074219, -124.89443206787, 997.9921875
        elseif type == 2 then
            osszeg = 25000
            intid = 24
            ix, iy, iz = 610.23449707031, -1.8843175172806, 1000.921875
        elseif type == 3 then
            osszeg = 50000
            intid = 10
            ix, iy, iz = 1403.0490722656, -2.8066546916962, 1000.910949707
        else
            outputChatBox("#00aeefHasználat:#ffffff /" .. commandName .. " [1 = Small | 2 = Medium | 3 = High]", thePlayer, 255, 255, 255, true)
            return
        end
            
        
        intbel = interiors[tonumber(intid)]
        local interiorid = intbel[1]    
        name = "Garázs"

        local query = dbQuery(con, "INSERT INTO interiors SET x = ?, y = ?, z = ?, interiorx = ?, interiory = ?, interiorz = ?, name = ?, type = ?, cost = ?, interior = ?,intid = ?",x, y, z, ix, iy, iz, name, 4, osszeg, interiorid,intid)
        local insertered, _, insertid = dbPoll(query, -1)
        if insertered then
            loadOneInteriorWhereID(insertid)
            outputChatBox("#1E8BC3[Garázs]:#ffffff You have been create a garage!. (ID: " .. insertid .. " | Típus: " .. tipus .. " | Ár: " .. osszeg .. "$)", thePlayer, 255 ,255, 255, true)
            exports.mta_admin:outputAdminMessage("#00aeef" .. getElementData(thePlayer, "char:anick") .. "#ffffff created a grage. (ID: " .. insertid .. " | Típus: " .. tipus .. " | Ár: " .. osszeg .. "$)")
        else
            outputChatBox("sikertelen sql mentés", thePlayer, 255, 255, 255, true)
        end    
    end
end
addCommandHandler("addgarage", addGarage, false, false)

Edited by Tibix99
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...