Szerző Téma: Gate(kapu) warning  (Megtekintve 916 alkalommal)

Gate(kapu) warning
« Dátum: 2017. Augusztus 22. - 16:47:14 »
0 Show voters
Sziasztok, az lenne a problémám hogy csináltam egy gate systemet, ami mükődik is, ki nyitja/zárja a kaput, de miközbe beírom hogy /gate ezt a warningot írja és eléggé idegesít.
 

moveObject(gates[gate][\"gate\"], 1500, gates[gate][\"defaultState\"][1], gates[gate][\"defaultState\"][2], gates[gate][\"defaultState\"][3], gates[gate][\"defaultState\"][4], gates[gate][\"defaultState\"][5], gates[gate][\"defaultState\"][6], \"OutQuad\")

 
Ennél a sornál írja a warningot.http://kephost.com/image/B2FP
 
Előre köszönöm a válaszokat!
 

Gate(kapu) warning
« Válasz #1 Dátum: 2017. Augusztus 22. - 18:29:48 »
0 Show voters
1-szer elég kirakni. A szkript többi része?

Gate(kapu) warning
« Válasz #2 Dátum: 2017. Augusztus 22. - 18:35:57 »
0 Show voters

local connection = exports.mta_connection:getConnection()
function loadAllGate()
gates = {}
local queryHandler = dbQuery(connection, \"SELECT * FROM gates\")
local result, num, errorMsg = dbPoll(queryHandler, 10)
if result > 0 then
   for key, row in ipairs(result) do
      local gateId = tonumber(row[\"id\"])
      gates[key] = {}
      gates[key][\"sqlId\"] = gateId
      gates[key][\"modelId\"] = tonumber(row[\"modelId\"])
      gates[key][\"lockState\"] = true
      gates[key][\"defaultState\"] = fromJSON(row[\"defaultState\"])
      gates[key][\"changeState\"] = fromJSON(row[\"changeState\"])
      gates[key][\"createRotation\"] = fromJSON(row[\"createRotation\"])
      gates[key][\"IndDim\"] = fromJSON(row[\"IndDim\"])
 
      gates[key][\"gate\"] = createObject(gates[key][\"modelId\"], gates[key][\"defaultState\"][1], gates[key][\"defaultState\"][2], gates[key][\"defaultState\"][3], gates[key][\"defaultState\"][4], gates[key][\"defaultState\"][5], gates[key][\"defaultState\"][6])
      setElementRotation(gates[key][\"gate\"], gates[key][\"createRotation\"][1], gates[key][\"createRotation\"][2], gates[key][\"createRotation\"][3])
      setElementInterior(gates[key][\"gate\"], gates[key][\"IndDim\"][1])
      setElementDimension(gates[key][\"gate\"], gates[key][\"IndDim\"][2])
   end
end
outputDebugString(#gates .. \" gate(s) loaded\")
end
addEventHandler(\"onResourceStart\", resourceRoot, loadAllGate)
addCommandHandler(\"creategate\", function (player, cmd, modellID, changex, changey, changez)
if player then
   if modellID and changex and changey and changez then
      if getElementData(player, \"acc:admin\") >= 8 then
         local x, y, z = getElementPosition(player)
         local rotx, roty, rotz = getElementRotation(player)
         local int = getElementInterior(player)
         local dim = getElementDimension(player)
         dbExec(connection, \"INSERT INTO gates SET defaultState = ?, createRotation = ?, changeState = ?, modelId = ?, IndDim = ? \", toJSON({x, y, z}), toJSON({rotx, roty, rotz}), toJSON({tonumber(changex), tonumber(changey), tonumber(changez)}), modellID, toJSON({int, dim}))
         outputChatBox(\"#7cc576\'Sikeres\' #ffffff Létrehozás\", player, 255, 255, 255, true)
      end
   else
      outputChatBox(\"[Használat] /\".. cmd ..\" #[Modell ID] [Mozgás X] [MozgásY] [Mozgás Z]\", player, 255, 255, 255, true)
   end
end
end)
addCommandHandler(\"gate\", function(player)
local gate = getClosestGate(player)
if gate then
   if (not exports[\"mta_item\"]:hasItemS(player, 36, tonumber(gate)) or false) and getElementData(player, \"acc:admin\") <= 5 then
      outputChatBox(\"Nincs kulcsod a kapuhoz.\", player, 255, 255, 255, true)
      return
   end

   if getElementData(gates[gate][\"gate\"], \"inUse\") then
      return
   end
   setElementData(gates[gate][\"gate\"], \"inUse\", true)
   if gates[gate][\"lockState\"] then
      moveObject(gates[gate][\"gate\"], 1500, gates[gate][\"changeState\"][1], gates[gate][\"changeState\"][2], gates[gate][\"changeState\"][3], gates[gate][\"changeState\"][4], gates[gate][\"changeState\"][5], gates[gate][\"changeState\"][6], \"OutQuad\")
      setElementInterior(gates[gate][\"gate\"], gates[gate][\"IndDim\"][1])
      setElementDimension(gates[gate][\"gate\"], gates[gate][\"IndDim\"][2])
   else
      moveObject(gates[gate][\"gate\"], 1500, gates[gate][\"defaultState\"][1], gates[gate][\"defaultState\"][2], gates[gate][\"defaultState\"][3], gates[gate][\"defaultState\"][4], gates[gate][\"defaultState\"][5], gates[gate][\"defaultState\"][6], \"OutQuad\")
      setElementInterior(gates[gate][\"gate\"], gates[gate][\"IndDim\"][1])
      setElementDimension(gates[gate][\"gate\"], gates[gate][\"IndDim\"][2])
   end
   
   gates[gate][\"lockState\"] = not gates[gate][\"lockState\"]
   setTimer(function()
      setElementData(gates[gate][\"gate\"], \"inUse\", false)
   end, 1500, 1)
end
end)
addCommandHandler(\"nearbygate\", function(player)
local gate = getClosestGate(player)
if gate then
   outputChatBox(\"Legközelebbi kapu: #7cc576\"..gate, player, 0, 0, 0, true)
else
   outputChatBox(\"Nincs a közeledben kapu.\", player, 0, 0, 0, true)      
end
end)
function getClosestGate(p1)
local x, y, z = getElementPosition(p1)
local dis = 99999
local dis2 = 0
local gate = false
for key, value in ipairs(gates) do
   local x2, y2, z2 = getElementPosition(gates[key][\"gate\"])
   dis2 = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
      
   if tonumber(dis2) < tonumber(dis) and tonumber(dis2) <= 9 then
      dis = dis2
      gate = key
   end
end
return gate
end

 
 
« Utoljára szerkesztve: 2017. Augusztus 22. - 23:43:47 írta danika98766 »

Gate(kapu) warning
« Válasz #3 Dátum: 2017. Augusztus 22. - 20:07:45 »
+3 Show voters
Azonnal mondom mi a probléma..... EXTERNAL.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal