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: 4886 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 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)


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: 27
Na forum: 4156 dni
Posty: 925
Nick w MP: #AteX

Piwa: 8366

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: 4886 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 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