Jump to content

Insigne

Members
  • Posts

    11
  • Joined

  • Last visited

About Insigne

  • Birthday 03/10/2002

Details

  • Location
    Hungary

Recent Profile Visitors

514 profile views

Insigne's Achievements

Square

Square (6/54)

0

Reputation

  1. Insigne

    BindKey

    look at this. https://wiki.multitheftauto.com/wiki/BindKey
  2. realTime function. function getRealTimeForIPB(time) local time = getRealTime(time) local str = "" if (time.hour < 10) then str = "0"..time.hour else str = time.hour end if (time.minute < 10) then str = str..":0"..time.minute else str = str..":"..time.minute end if (time.second < 10) then str = str..":0"..time.second else str = str..":"..time.second end return str end
  3. check this script. https://community.multitheftauto.com/index.php?p=resources&amp;s=details&amp;id=12699
  4. What do you want to do with setVehicleDoorState function?
  5. Hello guys, i have a big problem. I created some object in interior, after the script was loaded, it did not create the objects. HERE THE SCRIPT pls help local mysql = exports.mta_connection:getConnection() local loadedRoulettePoints = 0 function createRoulettePoint(x,y,z,r,i,d,player) x = tonumber(x) y = tonumber(y) z = tonumber(z) r = tonumber(r) i = tonumber(i) d = tonumber(d) local insertQuery = dbQuery(mysql, "INSERT INTO roulettes SET position = ?", toJSON({x, y, z, r, i, d})) local insertResult, insertNumber, insertID, inti, dim = dbPoll(insertQuery, -1) local inti = getElementInterior(player) local dim = getElementDimension(player) if insertResult then temp = createObject(1978, x, y, z, 0, 0, r) if isElement(temp) then setElementData(temp, "dbid", insertID) setElementInterior(temp, inti) setElementDimension(temp, dim) setElementData(temp, "isRefill", true) for k,v in ipairs(getElementsByType("player")) do if getElementData(v,"acc:admin") >= 7 then outputChatBox("#7cc576[New - Network]:#0094ff "..getElementData(player, "char:anick").." #fffffflétrehozott egy rulett asztalt. ID:#7cc576 "..insertID,v,255,255,255,true) end end end end end addCommandHandler("createroulette", function(player) if getElementData(player, "acc:admin") >= 7 then x,y,z = getElementPosition(player) _,_,r = getElementRotation(player) i = getElementInterior(player) d = getElementDimension(player) createRoulettePoint(x,y,z,r,i,d,player) end end) addCommandHandler("delroulette", function(player) if getElementData(player, "acc:admin") < 7 then return end local id = getNearestRoulettePoint(player) local interiorka = getElementInterior(player) if id ~= -1 and getElementData(id, "isRefill") then id = getElementData(id, "dbid") interiorka = getElementData(interiorka, "dbid") end if id == -1 then outputChatBox("#D63F3E[New - Network]: #ffffffNincs a közeledben rulett asztal.", player, 0, 0, 0, true) return end local qh = dbQuery(mysql, "DELETE FROM roulettes WHERE id = ?", id) local removeResult, _, removeID = dbPoll(qh, -1) if removeResult then for k,v in ipairs(getElementsByType("player")) do if getElementData(v,"acc:admin") >= 1 then outputChatBox("#7cc576[New - Network]:#0094ff "..getElementData(player, "char:anick").." #fffffftörölt egy rulett asztalt.",v,255,255,255,true) end end for k,v in ipairs(getElementsByType("object")) do if getElementData(v, "isRefill") and getElementData(v, "dbid") == id then destroyElement(v) end end end end) function getNearestRoulettePoint(ep) local pe = {getElementPosition(ep)} local dis = 2 local dis2 = 0 local obj = -1 local type = "object" for key, value in ipairs(getElementsByType(type)) do local p2 = {getElementPosition(value)} dis2 = getDistanceBetweenPoints3D (pe[1], pe[2], pe[3], p2[1], p2[2], p2[3]) if tonumber(dis2) < tonumber(dis) then dis = dis2 obj = value end end return obj end function loadRoulettePoints(resource, object) if resource ~= getThisResource() then return end loadedRoulettePoints = 0 local loaderQuery = dbPoll(dbQuery(mysql, "SELECT * FROM roulettes"), -1) if loaderQuery then for key, value in ipairs(loaderQuery) do local id = tonumber(value["id"]) local position = fromJSON(value["position"]) local interior, dimension = getElementsByType("object") local inti = getElementInterior(interior) local dim = getElementDimension(dimension) for a, p in ipairs (getElementsByType("object")) do if p then local loadedRoulettes = createObject(1978, position[1], position[2], position[3], 0, 0, position[4]) setElementData(loadedRoulettes, "dbid", id) setElementInterior(loadedRoulettes, inti) setElementDimension(loadedRoulettes, dim) setElementDoubleSided(loadedRoulettes, true) local loadedPedPoint = createPed(123, position[1], position[2], position[3], position[4]+90) setElementData(loadedPedPoint, "dbid", id) --setElementInterior(loadedPedPoint, inti) --setElementDimension(loadedPedPoint, dim) end end loadedRoulettePoints = loadedRoulettePoints + 1 end outputDebugString(loadedRoulettePoints .. " rulett asztal betöltve.") end end addEventHandler("onResourceStart", resourceRoot, loadRoulettePoints)
×
×
  • Create New...