Hallo ich habe ein Problem mit dem Auto zerstören.
Hier die Fehlermeldung:
86: attempt to call global 'destroyElement' (a nil value)
Die Lua Datei
Spoiler anzeigen
Lua
local anfangsmarker = createMarker ( -1616.400390625, 684.400390625, 7.1999998092651, "corona", 1, 255, 0, 0, 255, getRootElement() )
local machbar_Status = "ja"
function info_marker_func ( player )
if isOnDuty ( player ) then
outputChatBox("Gib /transport ein um einen Geld Transporter zu starten!", player, 255, 0, 0 )
else
outputChatBox("Du bist in keiner Staatsfraktion oder nicht On Duty!", player, 255, 0, 0 )
end
end
addEventHandler("onMarkerHit", anfangsmarker, info_marker_func )
function geld_anfang_func ( player )
if machbar_Status == "ja" then
if isOnDuty ( player ) then
if getDistanceBetweenPoints3D ( -1616.400390625, 684.400390625, 7.1999998092651, getElementPosition ( player ) ) < 5 then
machbar_Status = "nein"
geldcar = createVehicle ( 428, -1612, 673.2001953125, 7.5, 0, 0, 180, "Geld", 0, 0, 0 )
andromeda = createVehicle ( 592, 2112.900390625, -2445.599609375, 14.800000190735, 0, 0, 180, "Trol", 0, 0, 0 )
setElementFrozen ( andromeda, true )
setElementFrozen ( geldcar, true )
setTimer(
function ()
setElementFrozen ( geldcar, false )
outputChatBox("Der Wagen ist fertig beladen!", player, 0, 255, 0 )
end, 60000, 1)
setTimer(
function ()
machbar_Status = "ja"
end, 21600000, 1 )
outputChatBox("Der Wagen steht drausen, er wird beladen", player, 255, 0, 0 )
local msg = "Ein Geldtransporter wurde am PD beladen, beschuetzt ihn!"
local msg1 = "Ein Geldtransporter wurde beladen"
sendMSGForFaction ( msg, 1, 255, 0, 0 )
sendMSGForFaction ( msg, 6, 255, 0, 0 )
sendMSGForFaction ( msg, 8, 255, 0, 0 )
sendMSGForFaction ( msg1, 2, 255, 0, 0 )
sendMSGForFaction ( msg1, 3, 255, 0, 0 )
sendMSGForFaction ( msg1, 7, 255, 0, 0 )
sendMSGForFaction ( msg1, 9, 255, 0, 0 )
sendMSGForFaction ( msg1, 12, 255, 0, 0 )
sendMSGForFaction ( msg1, 5, 255, 0, 0 )
finishmarker = createMarker ( 2112.1999511719, -2423.6999511719, 13.5, "checkpoint", 2, 255, 0, 0, 255, getRootElement () )
finishblip = createBlip ( 2112.1999511719, -2423.6999511719, 13.5, 41, 1, 255, 0, 0, 255, 0, 9999, getRootElement () )
addEventHandler ( "onVehicleExplode", geldcar,
function ()
local smsg = "Der Geldtransporter wurde gestoppt!"
sendMSGForFaction( smsg, 1, 255, 0, 0 )
sendMSGForFaction( smsg, 2, 255, 0, 0 )
sendMSGForFaction( smsg, 3, 255, 0, 0 )
sendMSGForFaction( smsg, 5, 255, 0, 0 )
sendMSGForFaction( smsg, 6, 255, 0, 0 )
sendMSGForFaction( smsg, 7, 255, 0, 0 )
sendMSGForFaction( smsg, 8, 255, 0, 0 )
sendMSGForFaction( smsg, 9, 255, 0, 0 )
sendMSGForFaction( smsg, 12, 255, 0, 0 )
destoryElement ( finishblip )
destoryElement ( finishmarker )
end)
addEventHandler ( "onMarkerHit", finishmarker, finish )
end
end
end
end
addCommandHandler ( "transport", geld_anfang_func )
function finish ( player )
local car = getPedOccupiedVehicle ( player )
local fraktion = vioGetElementData ( player, "fraktion" )
if isOnDuty ( player ) then
if car then
if getPedOccupiedVehicleSeat ( player ) == 0 then
if getElementModel ( car ) == 428 then
setElementFrozen ( geldcar, true )
outputChatBox("Warte 1 Minute, bis der Wagen abgeladen ist!", player, 255, 0, 0 )
setTimer(
function (player)
local money = math.random ( 25000, 50000 )
local car = getPedOccupiedVehicle ( player )
if depotFactions[faction] then
local money = math.floor ( math.abs ( tonumber ( money ) ) )
factionDepotData["money"][faction] = factionDepotData["money"][faction] + money
MySQL_SetString("fraktionen", "DepotGeld", factionDepotData["money"][faction], "ID = '"..faction.."'")
outputChatBox(money.."$ wurde auf deine Fraktions Kasse ueberwiesen!", player, 0, 255, 0 )
end
destoryElement ( geldcar )
outputChatBox("Der Polizei Geldtransporter wurde erfolgreich abgegeben!", getRootElement(), 0, 255, 0 )
destoryElement ( andromeda )
end, 60000, 1 )
end
end
end
end
end
Alles anzeigen
mfg
Noel007