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

Wysłany: 2014-12-08, 13:51


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
Witam.

Jak zrobi? aby ten kod, kt?ry usuwa pojazd podczas gdy gracz wyjdzie z serwera dzia?a? r?wnie? identycznie po wyj?ciu gracza z auta ?


addEventHandler("onPlayerQuit",root, -- po wyjsciu z gry betoniarka znika
function ()
    local betoniarka auto[source] 
    if betoniarka then
        if isElementbetoniarka then
            destroyElementbetoniarka ) -- usuwa betoniarke 
        end
        auto[source]= nil
    end
end)


Pozdrawiam i za pomoc daje :arrow: :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-08, 15:14


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

zapoznaj si? z tym eventem :


Więcej informacji znajdziesz w Wikipedii MTA:

onPlayerVehicleExit


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-08, 21:15


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
Zrobi?em sobie takie co? :


DotWychodzenia z serwera

addEventHandler("onPlayerQuit",root, -- po wyjsciu z gry betoniarka znika
function ()
    local betoniarka auto[source] 
    if betoniarka then
        if isElementbetoniarka then
            destroyElementbetoniarka ) -- usuwa betoniarke 
        end
        auto[source]= nil
    end
end)

DotWysiadania z pojazdu

function removeHelmetOnExit vehicleseatjacked )
  local betoniarka auto[source] 
    if betoniarka then
        if isElementbetoniarka then
            destroyElementbetoniarka ) -- usuwa betoniarke 
        end
        auto[source]= nil
    end
  end
addEventHandler "onPlayerVehicleExit"getRootElement(), removeHelmetOnExit )


Lecz, gdy wysiadam z pojazdu to pojazd nie znika...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-08, 21:17


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

zauwa?, ?e w tym evencie source to gracz nie pojazd.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-08, 21:33


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
Shuffle, czyli jak usune source to zadzia?a ?

[ Dodano: 2014-12-08, 21:48 ]
usun??em source i dalej nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-08, 21:52


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Nie masz go usun?? tylko zamieni? na odpowiednie argumenty.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-08, 22:02


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
Shuffle, zrobi?em te? co? takiego :


addEventHandler("onPlayerVehicleExit",root, -- po wyjsciu z gry betoniarka znika 
function (theVehicle) 
    local betoniarka =  getElementModel theVehicle )
    if betoniarka == 406 then
        if isElementbetoniarka then 
            destroyElementbetoniarka ) -- usuwa betoniarke 
        end 
    end 
end)


Ale te? to dzia?a? nie chce.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-09, 07:05


Zgredek666

LUA






Wiek: 27
Na forum: 4722 dni
Posty: 251
Nick w MP: Zgredek

Piwa: 442

Respekt: 70,1

Drugim argumentem tej funkcji jest betoniarka, a tak apropo to ten kod bedzie kasowa? ka?d? betoniark? a nie tylko gracza.

Podpis
Piszę skrypty lua na serwery Truck/RPG/Race/DayZ. Kontakt pw!

Pomogłem? Wystarczy jak postawisz :piwo:



Zapraszam na mój kanał na yt:
https://www.youtube.com/c...vgsF65M-Xw5hEDQ
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-09, 12:13


markob0







Wiek: 27
Na forum: 4247 dni
Posty: 151
Nick w MP: Markob

Piwa: 939

Respekt: 98,2

A nie mo?na zamieni? Onplayerquit z OnPlayerVehicleexit?

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-09, 12:43


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

zamiast zmiennej betoniarka u?yj theVehicle

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-09, 13:37


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%

addEventHandler("onPlayerVehicleExit",root, -- po wyjsciu z gry betoniarka znika 
function (theVehicle) 
    local theVehicle =  getElementModel theVehicle )
    if theVehicle == 406 then
        if isElementtheVehicle then 
            destroyElementtheVehicle ) -- usuwa betoniarke 
        end 
    end 
end)


kodzik mam taki i dalej nie usuwa betoniarki ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-09, 13:41


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

nwm po co podmieniasz zmienn?..

addEventHandler("onPlayerVehicleExit",root, -- po wyjsciu z gry betoniarka znika 
function (theVehicle) 
    local id=  getElementModel theVehicle )
    if id== 406 then
        if isElementtheVehicle then 
            destroyElementtheVehicle ) -- usuwa betoniarke 
        end 
    end 
end)


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-09, 14:22


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
Wszystko ?licznie dzia?a. Dzi?kuj? serdecznie :)

[ Dodano: 2014-12-09, 14:39 ]
A jak zrobi? aby w tym kodzie po wyj?ciu z pojazdu teleportowa?o gracza w te miejsce co jest w tym kodzie ?


addEventHandler("onPlayerVehicleExit",root, -- po wyjsciu z gry betoniarka znika 
function (theVehicle) 
    local id=  getElementModel theVehicle )
    if id== 406 then
        if isElementtheVehicle then 
            destroyElementtheVehicle ) -- usuwa betoniarke 
        SetPlayerPos(playerid81284010);
        end 
    end 
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-09, 14:54


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

zamie?

SetPlayerPos(playerid, 812, 840, 10);

na


setElementPosition source81284010 )


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-09, 15:02


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
Shuffle, w?a?nie mia?em edytowa? m?j post bo ju? zrobi?em :) Ale za to ?e odpisa?e? to piwko poleci :)

Dzi?ki jeszcze raz i temat do zamkni?cia :)

Postaw piwo autorowi tego posta
 

 
Tagi: znikanie :: 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