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

Wysłany: 2017-01-20, 08:22


Kuksss

guwno






Wiek: 22
Na forum: 3781 dni
Posty: 102
Nick w MP: guwnp

Piwa: 732

Respekt: 70,5

Ostrzeżeń: 100%
local function pojazdPusty(veh)
if not veh then return end
    local occupants getVehicleOccupants(veh)
    local seats getVehicleMaxPassengers(veh)
    if (not seatsthen 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(vtrue) return end
    setVehicleDamageProof(v,false)
    end
end

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

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


Chcia?em, ?eby samochody si? nie pali?y, nie wybucha?y, ale teraz wcale si? nie psuj?.. Za pomoc stawiam :piwo: .

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-20, 12:35


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466


local function pojazdPusty(veh)
if not veh then return end
    local occupants getVehicleOccupants(veh)
    local seats getVehicleMaxPassengers(veh)
    if (not seatsthen 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(vtrue) return end
    setVehicleDamageProof(v,false)
    end
end

addEventHandler "onVehicleEnter"root, function()
if source then
    if getElementData(source,"damageproof"then setVehicleDamageProof(sourcetrue) return end
    healt getElementHealth(source)
    if healt<300 then
    setElementHealth(source,301)
    end
end)

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


robione na szybko w szkole, nie sprawdzone.

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-20, 12:48


Kuksss

guwno






Wiek: 22
Na forum: 3781 dni
Posty: 102
Nick w MP: guwnp

Piwa: 732

Respekt: 70,5

Ostrzeżeń: 100%
Samochody niszcz? si?, ale wybuchaj? :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-20, 12:56


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240


function handleVehicleDamage(attackerweaponlossxyztyre)
    if getElementHealth(source)<350 or loss>getElementHealth(source)-300 then
        cancelEvent()
    end
end
addEventHandler("onClientVehicleDamage"roothandleVehicleDamage)

cside

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-22, 10:22


Kuksss

guwno






Wiek: 22
Na forum: 3781 dni
Posty: 102
Nick w MP: guwnp

Piwa: 732

Respekt: 70,5

Ostrzeżeń: 100%
Pawel5321, Dzi?ki, dziaa. Masz ode mnie piwo :)

[ Dodano: 2017-01-22, 10:22 ]
dzia?a*

Podpis
c***
Postaw piwo autorowi tego posta
 

 
Tagi: samochody :: się :: nie :: psują
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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