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

Wysłany: 2016-04-07, 23:08


Patrix100

Amator LUA.






Wiek: 26
Na forum: 3887 dni
Posty: 182
Nick w MP: .:Patrix:.

Piwa: 952

Respekt: 40,5

"noose" napisał/a:

"Patrix100" napisał/a:

ednak ma jaki? b?ad

W takim razie co? musisz robi? ?le.
Wy?lij mi logi z konsoli, od momentu startu serwera, pierwsze kilkana?cie linijek, sprawdz? czy skrypt si? za?adowa?

------------------ Konsola serwera s15617 ------------------
> start zdm
[2016-04-07 23:05:35startRequested by Console
[2016-04-07 23:05:35Starting zdm
[2016-04-07 23:05:35startResource 'zdm' started

Tylko takie cos w konsoli.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-04-07, 23:13


noose

JESTĘ SKRYPTERĘ






Wiek: 35
Na forum: 3756 dni
Posty: 222

Piwa: 2294

Respekt: 155,8
Respekt: 155,8Respekt: 155,8

Mam rozumie? ?e zdm to skrypt kt?ry Ci poda?em?
sprawd? czy przy kopiowaniu kodu z mojego posta nie omin??e? ?adnego znaku.
sprawd? met?, oraz spr?buj debugu

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-04-07, 23:23


Patrix100

Amator LUA.






Wiek: 26
Na forum: 3887 dni
Posty: 182
Nick w MP: .:Patrix:.

Piwa: 952

Respekt: 40,5

"noose" napisał/a:

Mam rozumie? ?e zdm to skrypt kt?ry Ci poda?em?
sprawd? czy przy kopiowaniu kodu z mojego posta nie omin??e? ?adnego znaku.
sprawd? met?, oraz spr?buj debugu

Takie cos w konsoli, jutro zobacze czy dziala bo juz kompa wylaczylem
[2016-04-07 23:20:14Resource 'zdm' changedreloading and starting
[2016-04-07 23:20:14Starting zdm
[2016-04-07 23:20:14zdm restarted successfully


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-04-07, 23:29


noose

JESTĘ SKRYPTERĘ






Wiek: 35
Na forum: 3756 dni
Posty: 222

Piwa: 2294

Respekt: 155,8
Respekt: 155,8Respekt: 155,8

AA, dobra... PRZEPRASZAM Z G?RY, ?LE PRZECZYTA?EM TROSZK?, MOJA WINA;)
Tobie chodzi?o o skrypt kt?ry uniemo?liwia rozwalanie pojazd?w, gdy nie ma w nim grczy, a ja poda?em Ci kod kt?ry uniemo?liwia wybuch gdy nikogo nie ma w poje?dzie:D Przepraszam z g?ry

Anty damage
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
    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)


BONUS:Anty blow
    local vehTimers = { };
    setTimer(
        function ( )
            for _vehicle in ipairs getElementsByType "vehicle" ) ) do
                if getElementHealth(vehicle) < 260 then
                    setElementHealthvehicle250 ); -- set vehicle health to "fire" health which is ~250
                    if not vehTimersvehicle then -- if we haven't set the timer 1 second earlier then:
                        setVehicleDamageProof( vehicle, true) -- it only need to be called once so set the bulletproof property
                        vehTimers[ vehicle ] = setTimer( setVehicleDamageProof, 120000, 1, vehicle, false); -- 5mins = 5 * 60sec = 300sec = 300000ms! It's NOT 500000ms
                    end
                elseif vehTimersvehicle ] and isTimervehTimersvehicle ] ) then -- if we set a timer earlier but the vehicle was repaired within the 5mins then:
                    setVehicleDamageProofvehiclefalse) -- disable bulletproof property
                    killTimervehTimersvehicle ] ); -- kill the timer
                    vehTimersvehicle ] = nil; -- remove the variable from the memory since we killed the timer and it's no longer timer variable
                end
            end
        end,1000, 0
    )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-04-08, 08:03


Patrix100

Amator LUA.






Wiek: 26
Na forum: 3887 dni
Posty: 182
Nick w MP: .:Patrix:.

Piwa: 952

Respekt: 40,5

"noose" napisał/a:

AA, dobra... PRZEPRASZAM Z G?RY, ?LE PRZECZYTA?EM TROSZK?, MOJA WINA;)
Tobie chodzi?o o skrypt kt?ry uniemo?liwia rozwalanie pojazd?w, gdy nie ma w nim grczy, a ja poda?em Ci kod kt?ry uniemo?liwia wybuch gdy nikogo nie ma w poje?dzie:D Przepraszam z g?ry

Anty damage
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
    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)


BONUS:Anty blow
    local vehTimers = { };
    setTimer(
        function ( )
            for _vehicle in ipairs getElementsByType "vehicle" ) ) do
                if getElementHealth(vehicle) < 260 then
                    setElementHealthvehicle250 ); -- set vehicle health to "fire" health which is ~250
                    if not vehTimersvehicle then -- if we haven't set the timer 1 second earlier then:
                        setVehicleDamageProof( vehicle, true) -- it only need to be called once so set the bulletproof property
                        vehTimers[ vehicle ] = setTimer( setVehicleDamageProof, 120000, 1, vehicle, false); -- 5mins = 5 * 60sec = 300sec = 300000ms! It's NOT 500000ms
                    end
                elseif vehTimersvehicle ] and isTimervehTimersvehicle ] ) then -- if we set a timer earlier but the vehicle was repaired within the 5mins then:
                    setVehicleDamageProofvehiclefalse) -- disable bulletproof property
                    killTimervehTimersvehicle ] ); -- kill the timer
                    vehTimersvehicle ] = nil; -- remove the variable from the memory since we killed the timer and it's no longer timer variable
                end
            end
        end,1000, 0
    )

Mam ten skrypt i nie dziala wlasnie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-04-09, 16:53


noose

JESTĘ SKRYPTERĘ






Wiek: 35
Na forum: 3756 dni
Posty: 222

Piwa: 2294

Respekt: 155,8
Respekt: 155,8Respekt: 155,8

Kod:

<meta>
<script src="twojanazwa.lua"/>
</meta>


nie dodawaj parametru type="" poprostu;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-04-09, 17:39


Patrix100

Amator LUA.






Wiek: 26
Na forum: 3887 dni
Posty: 182
Nick w MP: .:Patrix:.

Piwa: 952

Respekt: 40,5

Sprawdza?em ju? i nie dziala ;o

Podpis
Pomogłem? Wystarczy że podziękujesz albo dasz respekt :D
Wole respekt niz piwka :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-06-26, 21:42


noose

JESTĘ SKRYPTERĘ






Wiek: 35
Na forum: 3756 dni
Posty: 222

Piwa: 2294

Respekt: 155,8
Respekt: 155,8Respekt: 155,8

typ skryptu w mecie
dla antyblowa: type="server"/>
dla damage nie podawaj tego parametru. musi dzia?a?. AntyDamage jest zrobiony bodaj?e przez AteXa, a antyblow znalaz?em na OFICJALNYM forum o MTA, wi?c musi dzia?a? ;)

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: rozwalanie :: sie :: aut :: wchodzenie :: quotgquot
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Nie rozwalanie sie aut i wchodzenie na "G" 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