Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-12-05, 22:51


MaciekSteal







Wiek: 33
Na forum: 3742 dni
Posty: 26

Piwa: 1

Respekt: 50

Witam mam pytanie co zrobi? aby pojazd po zako?czeniu pracy si? usuwa?
oto ostatnia cz??? kodu


addEventHandler("onClientMarkerHit", resourceRoot, function(hit)
    if hit ~= localPlayer then return end
    if source ~= p.marker then
        local trawa = getElementData(hit, "trawa")
        if trawa > 99 then
        ("text")
            return
        end
        local traw = math.random(1,4)
        setElementData(hit, "trawa", trawa+traw)
        if getElementData(hit, "trawa") > 100 then
            setElementData(hit, "trawa", 100)
        end
        destroyElement(getElementData(source, "object"))
           destroyElement(source)
    end
end)

addEventHandler("onClientMarkerHit", resourceRoot, function(hit)
  if hit ~= localPlayer then return end
  if source ~= p.marker then return end
  local pojazd = getPedOccupiedVehicle(hit)
  if not pojazd then return end
  local trawa = getElementData(hit, "trawa")
  if not trawa then return end
  local hajs = getElementData(hit, "pieniadze")
  if trawa < 1 then return end
  fadeCamera(false)
  ("") -- notyfikacja
  setElementFrozen(pojazd, true)
  setTimer(function()
    fadeCamera(true)
    setElementFrozen(pojazd, false)
    local wyplata = 450*trawa/100
    wyplata = string.format("%1.2f", wyplata)
    setElementData(hit, "pieniadze", hajs+wyplata)
    trawa = string.format("%1d", trawa)
    noti("") -- to wycialem
    wyplata = false
    setElementData(hit, "trawa", 0)
    local markery = getElementsByType("marker", resourceRoot)
    for i,v in ipairs(markery) do
        if getElementData(v, "object") then
            destroyElement(getElementData(v, "object"))
           end
        destroyElement(v)
    end
  for i,v in ipairs(punkty) do
      punkt = createMarker(v[1], v[2], v[3]-1, "cylinder", 4, 255, 255, 255, 0)
      objekt = createObject(math.random(2672,2677), v[1], v[2], v[3]-1)
      setElementData(punkt, "object", objekt)
  end
  p.marker = createMarker(315.58, 1147.96, 8.59-1, "cylinder", 3, 255, 255, 255, 125)
  end, 5000, 1)
end)


Wielkie dzieki za pomoc

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 23:01


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Kt?ry event odpowiada za zako?czenie pracy?

Tam gdzie chcesz doda? usuwanie pojazdu, dopisz poni?sz? linijk?

destroyElement(getPedOccupiedVehicle(hit))


Więcej informacji znajdziesz w Wikipedii MTA:

destroyElement


Postaw piwo autorowi tego posta
 

 
Tagi: usuwanie :: pojazdu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Usuwanie pojazdu Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku