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

Wysłany: 2014-06-13, 15:56


maxerxxl







Wiek: 30
Na forum: 5067 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
Witam, mam pewien problem ot?? po rozwaleniu pojazdu tzn damaged.
Pojazd znika ale markery ju? nie.

Chodzi mi dok?adnie o to:
Kod:

addEventHandler("onVehicleDamage", resourceRoot, function(loss)
local kierowca=getVehicleController(source)
if not kierowca then return end
local pp=getElementData(kierowca, "egzaminP_vehicle")
if not pp or pp~=source then return end

if loss>5 then
local pojazd=getElementData(kierowca,"egzaminP_vehicle")
if not pojazd then return end
outputChatBox("Uszkodzi?e? pojazd! Oblewasz egzamin!", kierowca, 255,0,0)
removeElementData(kierowca,"egzaminP_vehicle")
removePedFromVehicle(kierowca)
destroyElement(pojazd)
end
end)


Pr?bowa?em doda? nawet cancelEvent ale na nic nie reaguje.

Pozosta?a cz??? skryptu:

Kod:

addEventHandler("onVehicleDamage", resourceRoot, function(loss)
local kierowca=getVehicleController(source)
if not kierowca then return end
local pp=getElementData(kierowca, "egzaminP_vehicle")
if not pp or pp~=source then return end

if loss>5 then
local pojazd=getElementData(kierowca,"egzaminP_vehicle")
if not pojazd then return end
outputChatBox("Uszkodzi?e? pojazd! Oblewasz egzamin!", kierowca, 255,0,0)
removeElementData(kierowca,"egzaminP_vehicle")
removePedFromVehicle(kierowca)
destroyElement(pojazd)
end
end)

addEventHandler("onPlayerQuit", root, function()
local pp=getElementData(source, "egzaminP_vehicle")
if not pp then return end
destroyElement(pp)
end)

addEventHandler("onVehicleStartExit", resourceRoot, function()
local kierowca=getVehicleController(source)
if not kierowca then return end
local pp=getElementData(kierowca, "egzaminP_vehicle")
if not pp or pp~=source then return end
local pojazd=getElementData(kierowca,"egzaminP_vehicle")
if not pojazd then return end
cancelEvent()
end)

-- Wchodz?? w marker uruchamiamy funkcj?
function MarkerHit(hitPlayer, matchingDimension)
if source == pmarker1 then
destroyElement ( pmarker1 )
pmarker2 = createMarker ( -1951.32, -65.27, 25.62, "checkpoint", 3.0, 255, 255, 255 )

elseif source == pmarker2 then
destroyElement ( pmarker2 )
pmarker3 = createMarker ( -1840.60, -117.41, 5.20, "checkpoint", 3.0, 255, 255, 255 )

elseif source == pmarker3 then
destroyElement ( pmarker3 )
pmarker4 = createMarker ( -1838.88, -222.55, 17.93, "checkpoint", 3.0, 255, 255, 255 )

elseif source == pmarker4 then
destroyElement ( pmarker4 )
pmarker5 = createMarker ( -1800.70, -262.32, 19.49, "checkpoint", 3.0, 255, 255, 255 )

elseif source == pmarker5 then
destroyElement ( pmarker5 )
pmarker6 = createMarker ( -1820.37, -575.19, 16.05, "checkpoint", 3.0, 255, 255, 255 )

elseif source == pmarker6 then
destroyElement ( pmarker6 )
pmarker7 = createMarker ( -1810.51, -778.16, 33.66, "checkpoint", 3.0, 255, 255, 255 )

elseif source == pmarker7 then
destroyElement ( pmarker7 )
pmarker8 = createMarker ( -1580.53, -1433.85, 41.27, "checkpoint", 3.0, 255, 255, 255 )
outputChatBox("Egzaminator: Prosz? zawr?ci? i jecha? za punktami.", hitPlayer)

elseif source == pmarker8 then
destroyElement ( pmarker8 )
pmarker9 = createMarker ( -1638.41, -1350.55, 46.59, "checkpoint", 3.0, 255, 255, 255 )
outputChatBox("Egzaminator: Prosz? si? trzyma? ca?y czas tej drogi.", hitPlayer)

elseif source == pmarker9 then
destroyElement ( pmarker9 )
pmarker10 = createMarker ( -1820.22, -535.26, 14.84, "checkpoint", 3.0, 255, 255, 255 )

elseif source == pmarker10 then
destroyElement ( pmarker10 )
pmarker11 = createMarker ( -1798.36, -210.54, 16.33, "checkpoint", 3.0, 255, 255, 255 )

elseif source == pmarker11 then
destroyElement ( pmarker11 )
pmarker12 = createMarker ( -1797.66, -116.39, 5.21, "checkpoint", 3.0, 255, 255, 255 )

elseif source == pmarker12 then
destroyElement ( pmarker12 )
pmarker13 = createMarker ( -1997.06, -68.18, 34.78, "checkpoint", 3.0, 255, 255, 255 )
outputChatBox("Egzaminator: Prosz? skr?ci? w lewo i trzyma? si? drogi prostej.", hitPlayer)

elseif source == pmarker13 then
destroyElement ( pmarker13 )
pmarker14 = createMarker ( -2021.73, -45.86, 35.06, "checkpoint", 3.0, 255, 255, 255 )
outputChatBox("Egzaminator: Prosz? zaparkowa? samoch?d w tym miejscu w kt?rym pan rozpocz?? prawo jazdy.", hitPlayer)

elseif source == pmarker14 then
destroyElement ( pmarker14 )
outputChatBox("Gratulacje! Zako?czy?e? prawo jazdy! Otrzymujesz prawo jazdy kat. B,C.", hitPlayer)
end
end
addEventHandler("onMarkerHit", getRootElement(), MarkerHit)


Za pomoc dzi?kuje

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-13, 17:55


monio







Wiek: 30
Na forum: 4887 dni
Posty: 319
Nick w MP: Monio99

Piwa: 3565

Respekt: 120,5
Respekt: 120,5

dodaj jeszcze pod tym
 destroyElement (pojazd)
to
 destroyElement (nazwa markerow)
Powinno ?miga? :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-13, 18:39


maxerxxl







Wiek: 30
Na forum: 5067 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
ale je?eli np porobie

destroyElement (nazwa markerow)
destroyElement (nazwa markerow2)
destroyElement (nazwa markerow3)

to Bad Argument, a chc? w?a?nie tego unikn?? :P

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-13, 20:25


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

maxerxxl, destroyElement ( marker ) dodaj.

Podpis

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

 
Wysłany: 2014-06-13, 20:33


maxerxxl







Wiek: 30
Na forum: 5067 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
czy mi si? nie zdaje ale powinno by? pmarker czy da?e? przyk?ad?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-13, 20:57


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

maxerxxl, przyk?ad.

Podpis

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

 
Wysłany: 2014-06-14, 10:10


monio







Wiek: 30
Na forum: 4887 dni
Posty: 319
Nick w MP: Monio99

Piwa: 3565

Respekt: 120,5
Respekt: 120,5

to samo napisa?em... . Robi?e? to na p?tli czy nie ??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-17, 15:18


maxerxxl







Wiek: 30
Na forum: 5067 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
nic nie mam na p?tli.

Postaw piwo autorowi tego posta
 

 
Tagi: markery :: amp :: prawo :: jazdy
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Markery & Prawo jazdy 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