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

Wysłany: 2018-07-01, 21:06


Kulegg







Wiek: 46
Na forum: 3266 dni
Posty: 283

Piwa: 20

Respekt: 50

Cze??, posiadam skrypt na community-dmvehicle

I auta graczom wybuchaj? jak sie pali, jak to zablokowa??

 function pojazdPusty(veh)
    local occupants = getVehicleOccupants(veh)
    local seats = getVehicleMaxPassengers(veh)
    if (not seats) then return true end
    for i=0,seats do
    local occupant = occupants[seat]
    if occupant and (getElementType(occupant)=="player" or getElementType(occupant)=="ped") then
        return false
    end
    end
    return true
end


for i,v in ipairs(getElementsByType("vehicle")) do
    if (pojazdPusty(v)) then
        setVehicleDamageProof(v,true)
    else
    if getElementData(v,"damageproof") then setVehicleDamageProof(v, true) return end
    setVehicleDamageProof(v,false)
    end
end

addEventHandler ( "onVehicleEnter", root, function()
    if getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
    setVehicleDamageProof(source, false)
end)

addEventHandler ( "onVehicleExit", root, function()
    if (pojazdPusty(source)) then
        setVehicleDamageProof(source, true)
    else
        if getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
        setVehicleDamageProof(source, false)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-01, 21:13


Query

SyndicateMTA






Wiek: 24
Na forum: 3213 dni
Posty: 319
Nick w MP: Query

Piwa: 5238

Respekt: 141
Respekt: 141

local function pojazdPusty(veh)
if not veh then return end
    local occupants = getVehicleOccupants(veh)
    local seats = getVehicleMaxPassengers(veh)
    if (not seats) then return true end
    for i=0,seats do
    local occupant = occupants[seat]
    if occupant and (getElementType(occupant)=="player" or getElementType(occupant)=="ped") and getPedOccupiedVehicleSeat(occupant) == i then
        return false
    end
    end
    return true
end


for i,v in ipairs(getElementsByType("vehicle")) do
    if (pojazdPusty(v)) then
        setVehicleDamageProof(v,true)
    else
    if getElementData(v,"damageproof") then setVehicleDamageProof(v, true) return end
    setVehicleDamageProof(v,false)
    end
end

addEventHandler ( "onVehicleEnter", root, function()
if source then
    if getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
    setVehicleDamageProof(source, false)
    end
end)

addEventHandler ( "onVehicleExit", root, function()
    if source then
    if (pojazdPusty(source)) then
        setVehicleDamageProof(source, true)
    else
        if getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
        setVehicleDamageProof(source, false)
    end
    end
end)

polecam ten kod, wzi??em go z its v1 powinien dzia?a? :) je?eli pomog?em postaw piwko ! :arrow: :piwo:

Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: auta :: graczom :: wybuchają :: dmvehicles)
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Auta graczom wybuchają ( dmvehicles) 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