Hallo User, ich habe ein komisches Problem, was ich eigentlich noch nie hatte. Das Script findet an einer stelle den Table nicht, und an der anderen Stelle ist er plötzlich wieder da.
Lua
local blitzerobs = {}
(...)
local function createBlitzers()
if not(handler) then outputServerLog("Keine MySQL Verbindung!!") return end
local result = mysql_query(handler, "SELECT * FROM blitzer;")
if(result) then
local dsatz
dsatz = mysql_fetch_assoc(result)
while (dsatz) do
local id = dsatz['ID']
blitzerobs[id] = createObject(1215, dsatz['X'], dsatz['Y'], dsatz['Z'])
setElementData(blitzerobs[id], "blitzer.maxspeed", tonumber(dsatz['SPEED']))
setElementData(blitzerobs[id], "blitzer.id", dsatz['ID'])
setObjectScale(blitzerobs[id], 1.7)
(...)
addEventHandler("onBlitzerDelete", getRootElement(), function(id)
outputChatBox(id)
outputChatBox(tostring(blitzerobs[id]))
(..)
--[[Gibt folgendes zurueck:
29
nil
]]
(...)
addCommandHandler("testlol", function(thePlayer, cmd, param)
outputChatBox(tostring(blitzerobs[param]))
end)
--[[Gibt folgendes zurueck:
userdata: 00001720
]]
Alles anzeigen
Ich verstehe die Welt nichtmehr. Falls jemand eine Lösung weiß, bitte sagt es hier.
Vielen Dank für alle Antworten!
mfg