Wysłany: 2016-07-14, 19:28
Shogo12345
LuA
Wiek: 31 Na forum: 4182 dni Posty: 48
Nick w MP: Artux
Piwa : 504
local prawko = createMarker (- 362.63 , 173.68 , 1008.38 , "cylinder" , 1.0 , 255 , 0 , 0 , 255 )
setElementDimension ( prawko , 1636 )
setElementInterior ( prawko , 3 )
local punktyJazdy = {
{- 1881.22 , 1075.64 , 44.88 },
{- 1879.94 , 1158.53 , 44.87 },
{- 1953.98 , 1170.94 , 44.87 },
{- 2066.12 , 1169.62 , 46.31 },
{- 2149.09 , 1170.31 , 55.16 },
{- 2271.45 , 1169.63 , 55.32 },
{- 2458.87 , 1197.90 , 34.64 },
{- 2551.22 , 1240.41 , 34.60 },
{- 2616.97 , 1189.02 , 34.60 },
{- 2744.18 , 1051.51 , 48.73 },
{- 2748.74 , 959.01 , 53.88 },
{- 2747.11 , 877.81 , 65.76 },
{- 2748.02 , 701.58 , 40.71 },
{- 2742.05 , 562.50 , 13.97 },
{- 2619.64 , 562.16 , 14.03 },
{- 2538.05 , 562.09 , 14.04 },
{- 2401.73 , 562.44 , 24.32 },
{- 2282.18 , 561.92 , 34.59 },
{- 2254.37 , 654.95 , 48.88 },
{- 2251.01 , 714.64 , 48.91 },
{- 2252.19 , 795.29 , 48.88 },
{- 2125.80 , 806.21 , 68.98 },
{- 2014.94 , 807.74 , 44.87 },
{- 1988.56 , 838.20 , 44.88 },
{- 1894.92 , 864.58 , 34.59 },
{- 1894.39 , 951.55 , 34.60 },
{- 1881.46 , 1047.95 , 44.88 },
}
function showNextCP ( plr )
local punkt = getElementData ( plr , "egzaminP_postep" )
local ile = punktyJazdy [ punkt ]
if not ile then
egzaminKoniec ( plr , true )
return
end
local marker = createMarker ( ile [ 1 ], ile [ 2 ], ile [ 3 ], "checkpoint" , 5 , 255 , 0 , 0 , 200 , plr )
setElementData ( plr , "egzaminP_marker" , marker )
if punktyJazdy [ punkt + 1 ] then
ile = punktyJazdy [ punkt + 1 ]
setMarkerTarget ( marker , ile [ 1 ], ile [ 2 ], ile [ 3 ])
end
end
addEventHandler ( "onMarkerHit" , resourceRoot , function( el , md )
if not isElement ( el ) or not md or getElementType ( el ) ~= "player" then return end
if isElementWithinMarker ( el , prawko ) then
if getElementData ( el , "gracz_licencja" ) == 1 then
exports . notification : showBox ( el , "info" , "Posiadasz ju?? prawo jazdy..." )
return
end
egzaminStart ( el )
return
end
if not isElementVisibleTo ( source , el ) then return end
local postep = getElementData ( el , "egzaminP_postep" )
if not postep then return end
if not punktyJazdy [ postep ] then return end
destroyElement ( source )
playSoundFrontEnd ( el , 12 )
postep = postep + 1
setElementData ( el , "egzaminP_postep" , postep )
showNextCP ( el )
end )
function egzaminStart ( plr )
setElementInterior ( plr , 0 )
setElementDimension ( plr , 0 )
local pojazd = createVehicle ( 589 , - 1853.79 , 1043.10 , 46.09 , 360.0 , 360.0 , 271.3 )
setElementData ( pojazd , "pojazd_przebieg" , math . random ( 10000 , 20000 ))
setElementData ( pojazd , "pojazd_paliwo" , math . random ( 50 , 100 ))
setElementData ( pojazd , "pojazd_opis" , "Egzamin prawa jazdy" )
warpPedIntoVehicle ( plr , pojazd )
setElementData ( plr , "egzaminP_postep" , 1 )
setElementData ( plr , "egzaminP_vehicle" , pojazd )
showNextCP ( plr )
return true
end
function egzaminKoniec ( plr , udany )
local pojazd = getElementData ( plr , "egzaminP_vehicle" )
if not pojazd then return end
destroyElement ( pojazd )
removePedFromVehicle ( plr )
removeElementData ( plr , "egzaminP_marker" )
removeElementData ( plr , "egzaminP_vehicle" )
if getElementData ( plr , "egzaminP_marker" ) and isElement ( getElementData ( plr , "egzaminP_marker" )) then
destroyElement ( getElementData ( plr , "egzaminP_marker" ))
end
setElementInterior ( plr , 3 )
setElementDimension ( plr , 1636 )
setElementPosition ( plr , 364.38 , 164.29 , 1008.38 )
if udany then
setElementData ( plr , "gracz_licencja" , 1 )
outputChatBox ( "* Gratulacje! Zda?es egzamin prawa jazdy!" , plr )
end
end
addEventHandler ( "onVehicleDamage" , resourceRoot , function( loss )
local kierowca = getVehicleController ( source )
if not kierowca then return end
local pojazd = getElementData ( kierowca , "egzaminP_vehicle" )
if not pojazd or pojazd ~= source then return end
if loss > 5 then
egzaminKoniec ( kierowca , false )
outputChatBox ( "* Uszkodziles pojazd! Koniec egzaminu!" , kierowca , 255 , 0 , 0 )
end
end )
addEventHandler ( "onPlayerWasted" , root , function()
local pojazd = getElementData ( source , "egzaminP_vehicle" )
if not pojazd then return end
destroyElement ( pojazd )
if getElementData ( source , "egzaminP_marker" ) and isElement ( getElementData ( source , "egzaminP_marker" )) then
destroyElement ( getElementData ( source , "egzaminP_marker" ))
end
end )
addEventHandler ( "onPlayerQuit" , root , function()
local pojazd = getElementData ( source , "egzaminP_vehicle" )
if not pojazd then return end
destroyElement ( pojazd )
if getElementData ( source , "egzaminP_marker" ) and isElement ( getElementData ( source , "egzaminP_marker" )) then
destroyElement ( getElementData ( source , "egzaminP_marker" ))
end
end )
addEventHandler ( "onVehicleStartExit" , resourceRoot , function()
cancelEvent ()
end )
Nie pokazuje mi markera.
Ostatnio zmieniony przez Shogo12345 2016-07-15, 14:24, w całości zmieniany 3 razy
Wysłany: 2016-07-14, 19:29
Emm
***** ***
Wiek: 32 Na forum: 3881 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Jeste? na dimensionie 1636 i interiorze nr 3?
Podpis
Użytkownik : 20.10.2015r
GTAO Member : 06.03.2016r
Support-Team : 20.01.2016r
Moderator : 30.03.2016r
Mod-Team : 08.10.2016r
Vice Admin : 04.05.2018r
Administrator : 03.05.2022r
[you]
! Koniecznie zapoznaj się z
regulaminem forum .
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również
regulaminy działów , w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez
Administrację , przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w
tym dziale .
Najważniejsze informacje od
Administracji możesz przeczytać
tutaj oraz
tutaj .
Wysłany: 2016-07-14, 19:33
Shogo12345
LuA
Wiek: 31 Na forum: 4182 dni Posty: 48
Nick w MP: Artux
Piwa : 504
Wysłany: 2016-07-14, 22:30
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
local prawko = createMarker (- 362.63 , 173.68 , 1008.38 , "cylinder" , 1.0 , 255 , 0 , 0 , 255 )
Testuj
Wysłany: 2016-07-14, 22:32
GabWas
Wiek: 24 Na forum: 3881 dni Posty: 289
Nick w MP: GabWas
Piwa : 65
Mi si? wydaj?, ?e albo numer dimension'a jest zbyt du?y, b?d? te? wysoko?? markera (pozycja Z).
Wysłany: 2016-07-15, 12:19
Shogo12345
LuA
Wiek: 31 Na forum: 4182 dni Posty: 48
Nick w MP: Artux
Piwa : 504
Wysłany: 2016-07-15, 13:03
Emm
***** ***
Wiek: 32 Na forum: 3881 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Ustaw kodowanie zasobu na UTF-8.
Podpis
Użytkownik : 20.10.2015r
GTAO Member : 06.03.2016r
Support-Team : 20.01.2016r
Moderator : 30.03.2016r
Mod-Team : 08.10.2016r
Vice Admin : 04.05.2018r
Administrator : 03.05.2022r
[you]
! Koniecznie zapoznaj się z
regulaminem forum .
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również
regulaminy działów , w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez
Administrację , przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w
tym dziale .
Najważniejsze informacje od
Administracji możesz przeczytać
tutaj oraz
tutaj .
Wysłany: 2016-07-15, 14:16
Shogo12345
LuA
Wiek: 31 Na forum: 4182 dni Posty: 48
Nick w MP: Artux
Piwa : 504
Ustawi?em ale i tak dalej nie dzia?a a do tego jeszcze nie pokazuje b?ed?w w debugscript 3
Wysłany: 2016-07-16, 09:19
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
Na pewno jeste? w interiorze 3 i dimensionie 1636 na pozycji: -362.63,173.68,1008.38
W ogole dziwne, 1KM nad ziemi? :O
Podpis
Jedyny kontakt ze mną to PW forum
Kod:
local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Wysłany: 2016-07-16, 11:37
Shogo12345
LuA
Wiek: 31 Na forum: 4182 dni Posty: 48
Nick w MP: Artux
Piwa : 504
Tak Jestem.
[ Dodano : 2016-07-17, 11:48 ]
Prosze o pomoc bo dalej mi nie pokazuje tego markera.
[ Dodano : 2016-07-18, 13:15 ]
Temat do Zamkniecia,Naprawi?em sam
Tagi: prawojazdy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: