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

Wysłany: 2017-07-22, 20:55


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Witam, w jaki spos?b dzia?a destroyElement, bardzo cz?sto mam z ni? problemy i chcia?bym si? dowiedzie?. Poprosz? r?wnie? jaki? przyk?ad

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-22, 21:04


amited







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

Piwa: 512

Respekt: 466
Respekt: 466


function destroyVehiclesOfModel(plr,cmd,modelID)
    -- get a table of all the vehicles that exist and loop through it
    local vehicles getElementsByType("vehicle")
    for i,v in ipairs(vehicles) do
        -- if the vehicle's ID is the one provided, destroy it
        if (getElementModel(v) == modelID) then
            destroyElement(v)
        end
    end
end
addCommandHandler("zniszcz",destroyVehiclesOfModel)

proste zastosowanie, wpisujesz /zniszcz 411 i niszczy wszystkie infki

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

 
Więcej szczegółów
Wystawiono 1 piw(a):
Kalizman
Wysłany: 2017-07-22, 21:05


Artystek







Wiek: 23
Na forum: 3520 dni
Posty: 143
Nick w MP: Artystek

Piwa: 74

Respekt: 55,3

 function destroyVehiclesOfModel(modelID)
    -- get a table of all the vehicles that exist and loop through it
    local vehicles getElementsByType("vehicle")
    for i,v in ipairs(vehicles) do
        -- if the vehicle's ID is the one provided, destroy it
        if (getElementModel(v) == modelID) then
            destroyElement(v)
        end
    end
end

destroyVehiclesOfModel(445) 



Więcej informacji znajdziesz w Wikipedii MTA:

destroyElement


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-22, 21:33


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

#close

Postaw piwo autorowi tego posta
 

 
Tagi: działanie :: quotdestroyelementquot
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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