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

Wysłany: 2014-12-19, 18:54


cayman11







Wiek: 30
Na forum: 4948 dni
Posty: 73



Respekt: 50

Ot?? zrobi?em system na prywatne samochody, oraz blip gdzie si? znajduj?. Ale mam problem, gdy, np. Sprzedam pojazd to blip mi zostaje, jak to usun??? destroyElement - ale gdzie to wsadzi??


local time=10000

function veh_blips()
    for i,v in pairs(getElementsByType("vehicle")) do
        if getElementData(v,"type")==1 then
            if getElementData(v,"owner")==getElementData(localPlayer,"pdid"then
                createBlipAttachedTo(v,0,1,255,0,0,255,0,9999,localPlayer)
            end
        --[[elseif getElementData(v,"type")==2 then
            if getElementData(v,"owner")==getElementData(localPlayer,"faction"then
                createBlipAttachedTo(v,0,1,255,116,13,255,0,9999,localPlayer)
            end--]]
        end
    end
end
setTimer(veh_blips,time,0)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-19, 19:02


TheTroll

Pan Majster






Wiek: 38
Na forum: 4764 dni
Posty: 219
Nick w MP: TheTroll

Piwa: 1114

Respekt: 120
Respekt: 120

U?yj takie funkcji. Nie testowane wi?c nie wiem czy dzia?a :)

function destroyBlipAttachedTo(element)
    local attachedElements getAttachedElements(element)
    if attachedElements then
        for iattachedElement in ipairs(attachedElements) do
            if getElementType(attachedElement) == "blip" then
                destroyElement(attachedElement)
            end
        end
    end
end


U?ycie: destroyBlipAttachedTo(element)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-19, 20:16


cayman11







Wiek: 30
Na forum: 4948 dni
Posty: 73



Respekt: 50

Nie dzia?a. Mo?liwe, ?e co? ?le robi?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-19, 20:18


Terr9909

Skrypter LUA






Wiek: 26
Na forum: 4234 dni
Posty: 346
Nick w MP: Split

Piwa: 1043

Respekt: 182,8
Respekt: 182,8Respekt: 182,8

u?yj:
destroyBlipAttachedTo(element)

podczas sprzedawania pojazdu graczowi.

Postaw piwo autorowi tego posta
 

 
Tagi: blip :: prywatny :: samochód.
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