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

Wysłany: 2016-01-26, 19:34


Toffiaaak.







Wiek: 23
Na forum: 4410 dni
Posty: 128
Nick w MP: Toffy.

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

Napisa?em sobie prost? komende kt?ra usuwa wszystkie nie uzywane pojazdy w dim 1.. nie ma b??d?w lecz gdy wpisze /usun nic si? nie dzieje tylko wy?wietla mi tekst ">> Uwaga.."
Mimo wszystko, nie usuwa mi pojazd?w.

addCommandHandler("usun", function(plr,vehicle)
    local accName getAccountName getPlayerAccount plr ) )
    if isObjectInACLGroup ("user."..accNameaclGetGroup "event" ) ) then
    outputChatBox(">> Uwaga..",root,255,0,0,true)
    for i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
                if ( getElementDimension ) == then
                if not getPlayerOccupiedVehicle(plr)==v then
                destroyElement(vehicle[v])
                end
            end
        end
    end
end)

Licz? na pomoc.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-26, 20:04


MIKAELmta







Wiek: 24
Na forum: 3979 dni
Posty: 311

Piwa: 10617

Respekt: 355,3
Respekt: 355,3Respekt: 355,3Respekt: 355,3Respekt: 355,3

S? to pojazdy panelowe ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-26, 20:14


Toffiaaak.







Wiek: 23
Na forum: 4410 dni
Posty: 128
Nick w MP: Toffy.

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

Nie, pojazdy tworze p?telk?.

local alto = {
    {4443825.13,-74.65,18.23,359.8,360.0,242.5}, 
    {4443829.95,-67.62,18.23,0.1,0.1,228.1}, 
    {4443835.90,-61.39,18.23,0.0,360.0,218.3},
    --
    {4443821.83,-81.41,18.23,0.0,0.0,240.3},
    {4443819.99,-88.61,18.23,359.7,0.0,262.8},
    {4443820.42,-95.59,18.23,0.0,360.0,273.3},
    {4443821.04,-101.31,18.23,0.1,359.9,278.0},
    {4443823.51,-107.52,18.23,0.0,360.0,292.9},
    {4443827.77,-114.80,18.23,0.1,359.9,300.9},
    {4443832.03,-120.56,18.23,0.0,360.0,318.2},
    {4443837.36,-124.35,18.23,360.0,0.0,318.3},
    {4443843.86,-127.54,18.23,0.1,0.1,333.7},
    {4443851.71,-129.49,18.23,360.0,0.0,342.6},
    {4443858.25,-130.78,18.23,0.1,0.1,5.1},
    {4443867.64,-129.26,18.23,359.9,0.1,16.6},
    {4443872.71,-126.74,18.23,0.4,0.1,24.8},
    {4443862.75,-129.84,18.23,360.0,0.0,14.6},
    --
    {4443842.03,-57.47,18.23,0.1,359.9,210.6},
    {4443847.66,-57.83,18.23,360.0,0.2,209.8},
    {4443853.36,-56.30,18.23,0.0,0.0,205.1},
    {4443858.70,-55.43,18.23,0.0,360.0,184.4},
    {4443865.26,-56.84,18.23,360.0,0.1,167.6},
    {4443870.46,-58.55,18.23,0.0,360.0,162.9},
    {4443875.01,-59.81,18.23,0.0,0.0,161.7},
    {4443880.39,-63.29,18.23,359.5,359.9,150.3}
}


for i,v in ipairs(alto) do
    local pojazd createVehicle(v[1], v[2], v[3], v[4], v[5], v[6], v[7])
    setElementDimension pojazd)    
    setElementFrozen(pojazdtrue)
    setElementData(pojazd"pojazd_opis""Event: Derby")
end


Podpis

Osiągnięcia:
- wygrana w konkursie LUA (kat. średnia) - 05.02.18
- 150 reputacji - 06.02.18
- 100 postów - 06.02.18

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-26, 20:19


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
A tworzysz je w tym samym skrypcie ?

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-26, 20:20


Toffiaaak.







Wiek: 23
Na forum: 4410 dni
Posty: 128
Nick w MP: Toffy.

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

Ca?y skrypt:

local alto = {
    {4443825.13,-74.65,18.23,359.8,360.0,242.5}, 
    {4443829.95,-67.62,18.23,0.1,0.1,228.1}, 
    {4443835.90,-61.39,18.23,0.0,360.0,218.3},
    --
    {4443821.83,-81.41,18.23,0.0,0.0,240.3},
    {4443819.99,-88.61,18.23,359.7,0.0,262.8},
    {4443820.42,-95.59,18.23,0.0,360.0,273.3},
    {4443821.04,-101.31,18.23,0.1,359.9,278.0},
    {4443823.51,-107.52,18.23,0.0,360.0,292.9},
    {4443827.77,-114.80,18.23,0.1,359.9,300.9},
    {4443832.03,-120.56,18.23,0.0,360.0,318.2},
    {4443837.36,-124.35,18.23,360.0,0.0,318.3},
    {4443843.86,-127.54,18.23,0.1,0.1,333.7},
    {4443851.71,-129.49,18.23,360.0,0.0,342.6},
    {4443858.25,-130.78,18.23,0.1,0.1,5.1},
    {4443867.64,-129.26,18.23,359.9,0.1,16.6},
    {4443872.71,-126.74,18.23,0.4,0.1,24.8},
    {4443862.75,-129.84,18.23,360.0,0.0,14.6},
    --
    {4443842.03,-57.47,18.23,0.1,359.9,210.6},
    {4443847.66,-57.83,18.23,360.0,0.2,209.8},
    {4443853.36,-56.30,18.23,0.0,0.0,205.1},
    {4443858.70,-55.43,18.23,0.0,360.0,184.4},
    {4443865.26,-56.84,18.23,360.0,0.1,167.6},
    {4443870.46,-58.55,18.23,0.0,360.0,162.9},
    {4443875.01,-59.81,18.23,0.0,0.0,161.7},
    {4443880.39,-63.29,18.23,359.5,359.9,150.3}
}

for i,v in ipairs(alto) do
    local pojazd createVehicle(v[1], v[2], v[3], v[4], v[5], v[6], v[7])
    setElementDimension pojazd)    
    setElementFrozen(pojazdtrue)
    setElementData(pojazd"pojazd_opis""Event: Derby")
end

addCommandHandler("respawnderby", function(plr)
    local accName getAccountName getPlayerAccount plr ) )
    if isObjectInACLGroup ("user."..accNameaclGetGroup "event" ) ) then
    for i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
            respawnVehicle(v)
            setElementFrozen(vtrue)
            setVehicleEngineState vfalse )
    end
    end
end)

addCommandHandler("derbykoniec", function(thePlayer)
    local accName getAccountName getPlayerAccount thePlayer ) )
    if isObjectInACLGroup ("user."..accNameaclGetGroup "event" ) ) then
    outputChatBox(">> Koniec derb?w!",root,255,0,0,true)
    for k,v in ipairs getElementsByType "player" )) do
    if ( getElementDimension ) == then
    setElementDimension v) 
    setElementPosition v1477.61, -1704.1514.05 )
    end
    for i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
            respawnVehicle(v)
            setElementFrozen(vtrue)
            setVehicleEngineState vfalse )
    end    
    end
    end
end)

addCommandHandler("startderby", function(plr,vehicle)
    local accName getAccountName getPlayerAccount plr ) )
    if isObjectInACLGroup ("user."..accNameaclGetGroup "event" ) ) then
    outputChatBox(">> Derby START!",root,255,0,0,true)
    for i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
            setElementFrozen(vfalse)
    end
    end
end)


addCommandHandler("usun", function(plr,vehicle)
    local accName getAccountName getPlayerAccount plr ) )
    if isObjectInACLGroup ("user."..accNameaclGetGroup "event" ) ) then
    outputChatBox(">> Uwaga..",root,255,0,0,true)
    for i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
                if ( getElementDimension ) == then
                if not getPlayerOccupiedVehicle(plr)==v then
                destroyElement(vehicle[v])
                end
            end
        end
    end
end)


addCommandHandler("telederby", function(plr)
    local accName getAccountName getPlayerAccount plr ) )
    if isObjectInACLGroup ("user."..accNameaclGetGroup "event" ) ) then
    setElementPosition plr3859.21, -51.6023.20 )
    setElementDimension plrend
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-26, 20:26


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
O to tobie chodzi?o ?


    addCommandHandler("usun", function(plr,vehicle)
    local accName getAccountName getPlayerAccount plr ) )
    if isObjectInACLGroup ("user."..accNameaclGetGroup "event" ) ) then
    outputChatBox(">> Uwaga..",root,255,0,0,true)
    for i,v in ipairs(getElementsByType("vehicle",resourceRoot)) do
                if ( getElementDimension ) == then
                destroyElement(v)
                end
            end
        end
    end)


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-27, 15:06


Toffiaaak.







Wiek: 23
Na forum: 4410 dni
Posty: 128
Nick w MP: Toffy.

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

Nie, jeszcze chcia?em dodac do tego funkcje kt?ra sprawdza czy gracz jest w pojezdzie, pojazdy kt?re s? nie u?ywane w DIM 1 maj? by? usuwane.

Podpis

Osiągnięcia:
- wygrana w konkursie LUA (kat. średnia) - 05.02.18
- 150 reputacji - 06.02.18
- 100 postów - 06.02.18

Postaw piwo autorowi tego posta
 

 
Tagi: usuwanie :: nie :: używanych :: pojazdów
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