function seatRumpo(theVehicle, seat, jacked)
if(getElementModel(theVehicle) == 440 and getTeamName(getPlayerTeam(source)) ~= "Водители") then
local x, y, z = getElementPosition(theVehicle)
id = getElementModel(source)
spawnPlayer(source, x-1, y-2, z, 90, id)
setCameraTarget(source, source)
outputChatBox("У вас нет прав для доступа в данное транспортное средство", source)
elseif (getElementModel(theVehicle) == 440 and getTeamName(getPlayerTeam(source)) == "Водители") then
outputChatBox("Начинаем работу", source)
mark1 = createMarker(1104.0576171875, -1740.830078125, 11.5, "cylinder", 8, 255, 69, 0, 150)
function mark1Func()
if isElement(mark1) then
destroyElement(mark1)
end
mark2 = createMarker(1167.412109375, -1741.021484375, 11.5, "cylinder", 8, 255, 69, 0, 150)
end
function mark2Func(source)
if isElement(mark2) then
destroyElement(mark2)
end
outputChatBox("Вы прибыли в точку назначения!", source)
end
addEventHandler("onMarkerHit", mark1, mark1Func)
addEventHandler("onMarkerHit", mark2, mark2Func)
end
end
addEventHandler("onPlayerVehicleEnter", getRootElement(), seatRumpo)
I have 2 markers: mark1 and mark2. I need to delete marker, when player hit it. When I hit marker1, marker disappears, but when I hit marker2, nothing happens.
WARNING: work/server.lua:20: Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil]