Hey leute,
Ich habe eine feuerwher fraktion so nun möchte ich die autos eintragen und habe mir allerdings
den code von fbi genommen habe es auch schon mit dem von medic und yakuzza probiert:
Lua
addEvent ( "createCustomFire", true )
addEvent ( "fireIsNoMore", true )
local currentfire1
local currentfire2
local currentfirehp
local currentposition
function createCustomFire_func ( position )
if isElement ( currentfire1 ) then
fireIsNoMore_func ()
end
currentfire1 = createEffect ( "fire_large", position.x, position.y, position.z )
currentfire2 = createEffect ( "fire_large", position.x, position.y, position.z )
currentfirehp = 100
currentposition = { position.x, position.y, position.z }
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), extinguishFire )
end
addEventHandler ( "createCustomFire", getRootElement(), createCustomFire_func )
function extinguishFire ( weapon, _, _, hitX, hitY, hitZ, _, startX, startY, startZ )
if weapon == 42 then
if getDistanceBetweenPoints3D ( startX, startY, startZ, currentposition[1], currentposition[2], currentposition[3] ) <= 5 then
if ( currentposition[1] > startX and hitX > startX ) or ( currentposition[1] < startX and hitX < startX ) then
if ( currentposition[2] > startY and hitY > startY ) or ( currentposition[2] < startY and hitY < startY ) then
if ( currentposition[3] > startZ and hitZ > startZ ) or ( currentposition[3] < startZ and hitZ < startZ ) then
currentfirehp = currentfirehp - 10
if currentfirehp == 0 then
triggerServerEvent ( "fireExtinguished", getLocalPlayer() )
end
end
end
end
end
end
end
function fireIsNoMore_func ( )
if isElement ( currentfire1 ) then
destroyElement ( currentfire1 )
destroyElement ( currentfire2 )
end
currentfirehp = nil
currentposition = nil
removeEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), extinguishFire )
end
addEventHandler ( "fireIsNoMore", getRootElement(), fireIsNoMore_func )
Alles anzeigen
allerdings bekomme ich immer den fehler:
Der chat.lua error habe ich bereits gelöst!