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

Wysłany: 2016-05-09, 15:37


amama5







Wiek: 39
Na forum: 4745 dni
Posty: 57
Nick w MP: kamiloooswas

Piwa: 2

Respekt: 40,5

Ostrzeżeń: 100%
Witam, mam problem ze skryptem MIKELmta, ot?? jego skrypt nie dzia?a na moim serwerze. Jest dodany do acl, Jednak przy zaci?gni?tym r?cznym i tak da si? rozwala? pojazd zar?wno r?k? jak i innym pojazdem. Jak to naprawi? ?? Prosz? o pomoc. Za pomoc :piwo: i R*
Dodam ?e u?ywam systemu pojazd?w OGRPG.
Kod:

local function pojazdPusty(veh)
    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"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 getElementData(source,"damageproof"then setVehicleDamageProof(sourcetrue) return end
    setVehicleDamageProof(sourcefalse)
end)

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


Ostatnio zmieniony przez amama5 2016-05-09, 15:38, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-09, 15:38


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Debugscript co? pokazuje?

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-09, 15:40


amama5







Wiek: 39
Na forum: 4745 dni
Posty: 57
Nick w MP: kamiloooswas

Piwa: 2

Respekt: 40,5

Ostrzeżeń: 100%
AteX, Nic.

Postaw piwo autorowi tego posta
 

 
Tagi: nieniszczenie :: się :: 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 » Nieniszczenie się 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