Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: psują
1. Samochody się nie psują :/
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: .