Wysłany: 2018-03-14, 16:42
guciopl5
Wiek: 23 Na forum: 3146 dni Posty: 86
Nick w MP: Whit3
Piwa : 8
witajcie .. mam pewien problem ot?? robie sw?j serwer i doda?em skrypt prawo jazdy .. dzia?a? lecz postanowi?em przeniesc go do interioru urzedu .. no i po przeniesieniu i wejsciu w marker dzieje si? to
https://imgur.com/a/isRMJ --- urzad
https://imgur.com/a/kBCLY - po wej?ciu w marker
nwm czy dobrze trafi?em ale pomo?e mi ktos ?
Więcej szczegółów
Wystawiono 1 piw(a):Kamil98
Wysłany: 2018-03-14, 16:44
NyAngel
Wiek: 22 Na forum: 3950 dni Posty: 128
Nick w MP: NyAngel
Piwa : 556
Podaj kod od prawa jazdy.
Wysłany: 2018-03-14, 16:44
guciopl5
Wiek: 23 Na forum: 3146 dni Posty: 86
Nick w MP: Whit3
Piwa : 8
local screenW , screenH = guiGetScreenSize ()
function guiWejscie ()
dxDrawRectangle ( screenW * 0.3419 , screenH * 0.0143 , screenW * 0.3814 , screenH * 0.0703 , tocolor ( 0 , 0 , 0 , 200 ), false )
dxDrawText ( "* Aby wejsc do urzedu kliknij przycisk 'E'!" , ( screenW * 0.4495 ) + 1 , ( screenH * 0.0352 ) + 1 , ( screenW * 0.8097 ) + 1 , ( screenH * 0.0846 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , "default-bold" , "left" , "top" , false , false , false , false , false )
dxDrawText ( "* Aby wejsc do urzedu kliknij przycisk 'E'!" , screenW * 0.4495 , screenH * 0.0352 , screenW * 0.8097 , screenH * 0.0846 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default-bold" , "left" , "top" , false , false , false , false , false )
end
function guiWyjscie ()
dxDrawRectangle ( screenW * 0.3419 , screenH * 0.0143 , screenW * 0.3814 , screenH * 0.0703 , tocolor ( 0 , 0 , 0 , 200 ), false )
dxDrawText ( "* Aby wyjsc z urzedu kliknij przycisk 'E'!" , ( screenW * 0.4495 ) + 1 , ( screenH * 0.0352 ) + 1 , ( screenW * 0.8097 ) + 1 , ( screenH * 0.0846 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , "default-bold" , "left" , "top" , false , false , false , false , false )
dxDrawText ( "* Aby wyjsc z urzedu kliknij przycisk 'E'!" , screenW * 0.4495 , screenH * 0.0352 , screenW * 0.8097 , screenH * 0.0846 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default-bold" , "left" , "top" , false , false , false , false , false )
end
local marker = createMarker (- 1515.74 , 2591.09 , 55.83 + 0.6 , "arrow" , 1 , 25 , 255 , 25 )
local marker2 = createMarker ( 389.90 , 173.84 , 1008.38 + 0.6 , "arrow" , 1 , 25 , 255 , 25 )
setElementInterior ( marker2 , 3 )
function infoMarker ( el , md )
if not md or getElementType ( el ) ~= "player" then return end
if el ~= localPlayer then return end
addEventHandler ( "onClientRender" , root , guiWejscie )
setTimer (function()
removeEventHandler ( "onClientRender" , root , guiWejscie )
end , 1750 , 1 )
end
function infoMarker2 ( el , md )
if not md or getElementType ( el ) ~= "player" then return end
if el ~= localPlayer then return end
addEventHandler ( "onClientRender" , root , guiWyjscie )
setTimer (function()
removeEventHandler ( "onClientRender" , root , guiWyjscie )
end , 1750 , 1 )
end
addEventHandler ( "onClientMarkerHit" , marker , infoMarker )
addEventHandler ( "onClientMarkerHit" , marker2 , infoMarker2 )
bindKey ( "e" , "down" ,function()
player = localPlayer
if not isElementWithinMarker ( player , marker ) then return end
if getPedOccupiedVehicle ( player ) then return end
setElementPosition ( player , 386.74 , 174.30 , 1008.38 )
setElementInterior ( root , 3 )
end )
bindKey ( "e" , "down" ,function()
player = localPlayer
if not isElementWithinMarker ( player , marker2 ) then return end
if getPedOccupiedVehicle ( player ) then return end
setElementPosition ( player , 209.22 , - 68.38 , 1.43 )
setElementInterior ( root , 0 )
end )
[ size = 9 ][ [ i ][ b ] Dodano [/ b ]: 2018 - 03 - 14 , 16 : 48 [/ i ] ][/ size ]
yyy so
rry to nie to
[ size = 9 ][ [ i ][ b ] Dodano [/ b ]: 2018 - 03 - 14 , 16 : 48 [/ i ] ][/ size ]
local prawko = createMarker ( 359.00 , 164.37 , 1008.38 - 1 , "cylinder" , 1.5 , 0 , 125 , 125 , 255 )
local punktyJazdy = {
{- 210.72 , 2752.92 , 62.14 },
{- 255.60 , 2749.25 , 62.14 },
{- 261.41 , 2704.73 , 62.14 },
{- 373.17 , 2689.60 , 63.64 },
{- 496.67 , 2717.22 , 65.17 },
{- 669.99 , 2743.08 , 57.82 },
{- 897.10 , 2725.68 , 45.47 },
{- 1342.10 , 2644.28 , 50.06 },
{- 1427.61 , 2722.17 , 62.32 },
{- 1630.73 , 2724.74 , 57.3 },
{- 1629.25 , 2671.54 , 54.0 },
{- 1432.59 , 2668.04 , 55.2 },
{- 1428.40 , 2600.62 , 55.29 },
{- 1383.36 , 2595.85 , 55.35 },
{- 1433.72 , 2470.19 , 60.6 },
{- 1386.63 , 2244.65 , 54.39 },
{- 1331.77 , 1985.98 , 51.44 },
{- 1179.59 , 1797.23 , 40.13 },
{- 1019.95 , 1726.44 , 30.63 },
{- 859.87 , 1612.33 , 26.52 },
{- 846.97 , 1417.25 , 13.21 },
{- 727.69 , 1232.62 , 12.9 },
{- 577.40 , 1113.11 , 10.53 },
{- 397.64 , 1003.44 , 10.36 },
{- 296.81 , 809.74 , 14.34 },
{ 0.25 , 879.92 , 22.23 },
{ 226.69 , 969.67 , 27.79 },
{ 188.18 , 1141.93 , 14.28 },
{ 311.04 , 1277.22 , 13.20 },
{ 410.16 , 1589.83 , 17.42 },
{ 534.97 , 1679.41 , 11.07 },
{ 523.52 , 1714.50 , 10.57 },
{ 595.62 , 1844.41 , 14.33 },
{ 614.83 , 2010.26 , 35.47 },
{ 594.04 , 2159.82 , 38.54 },
{ 548.14 , 2328.54 , 31.98 },
{ 401.01 , 2370.79 , 24.90 },
{ 180.76 , 2284.77 , 21.97 },
{ 66.80 , 2303.70 , 20.88 },
{- 67.08 , 2339.74 , 20.39 },
{- 109.90 , 2458.24 , 13.92 },
{- 260.89 , 2518.30 , 32.36 },
{- 418.80 , 2453.45 , 44.47 },
{- 575.04 , 2425.80 , 66.73 },
{- 698.66 , 2519.93 , 74.82 },
{- 736.24 , 2649.28 , 63.51 },
{- 776.59 , 2724.04 , 44.95 },
{- 646.76 , 2744.49 , 60.32 },
{- 516.95 , 2712.18 , 65.62 },
{- 376.49 , 2684.56 , 64.10 },
{- 259.19 , 2699.65 , 62.14 },
{- 187.15 , 2699.91 , 62.14 },
{- 186.09 , 2748.80 , 62.16 },
{- 230.95 , 2753.00 , 62.14 },
{- 233.51 , 2729.45 , 62.29 },
}
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 , "prawojazdy" ) == 1 then
outputChatBox ( "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 , - 200.85 , 2751.78 , 62.53 , 0.0 , 360.0 , 89.6 )
setElementData ( pojazd , "pojazd_przebieg" , math . random ( 10000 , 20000 ))
setElementData ( pojazd , "pojazd_paliwo" , 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 , 0 )
setElementDimension ( plr , 0 )
setElementPosition ( plr , - 226.84 , 2707.51 , 62.69 )
if udany then
setAccountData ( getPlayerAccount ( plr ), "prawojazdy" , true )
outputChatBox ( "* Gratulacje! Zda?e? 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 ( "* Uszkodzi?e? 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 )
-------------------------------------------------------------------------------------
function dajprawko ( policjant , commandName , gracz )
local accName = getAccountName ( getPlayerAccount ( policjant ) )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "Admin" ) ) then
local gracz1 = getPlayerFromName ( gracz )
local nickgracza = getPlayerName ( gracz1 )
local nickpolicjanta = getPlayerName ( policjant )
local konto = getPlayerAccount ( gracz1 )
if not getAccountData ( konto , "prawojazdy1" ) then
outputChatBox ( "Da?e? prawo jazdy graczowi " .. nickgracza .. "" , policjant )
outputChatBox ( "Otrzyma?e? prawo jazdy od Administratora " .. nickpolicjanta .. "" , gracz1 )
setAccountData ( konto , "prawojazdy" , true )
else
outputChatBox ( "Gracz " .. nickgracza .. " posiada prawo jazdy" , policjant )
end
else
outputChatBox ( "Nie jeste? Administratorem!" , policjant )
end
end
addCommandHandler ( "daj.prawko.B" , dajprawko )
function sprawdzprawko ( policjant , commandName , gracz )
local accName = getAccountName ( getPlayerAccount ( policjant ) )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "Policja" ) ) then
local gracz1 = getPlayerFromName ( gracz )
local konto = getPlayerAccount ( gracz1 )
local nickgracza = getPlayerName ( gracz1 )
if not getAccountData ( konto , "prawojazdy1" ) then
outputChatBox ( "Gracz " .. nickgracza .. " nie posiada prawa jazdy" , policjant )
else
outputChatBox ( "Gracz " .. nickgracza .. " posiada prawo jazdy" , policjant )
end
else
outputChatBox ( "Nie jeste? policjantem!" , policjant )
end
end
addCommandHandler ( "zobacz.prawko.B" , sprawdzprawko )
function zabierzprawko ( policjant , commandName , gracz )
local accName = getAccountName ( getPlayerAccount ( policjant ) )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "suszarka" ) ) then
local gracz1 = getPlayerFromName ( gracz )
local konto = getPlayerAccount ( gracz1 )
local nickgracza = getPlayerName ( gracz1 )
local nickpolicjanta = getPlayerName ( policjant )
if not getAccountData ( konto , "prawojazdy" ) then
outputChatBox ( "Gracz " .. nickgracza .. " nie posiada prawa jazdy" , policjant )
else
setAccountData ( konto , "prawojazdy" , false )
outputChatBox ( "Zabra?e? prawo jazdy graczowi " .. gracz1 , policjant )
end
else
outputChatBox ( "Nie jeste? Administratorem!" , policjant )
end
end
addCommandHandler ( "zabierz.prawko" , zabierzprawko )
isCar = {[ 401 ]= true , [ 402 ]= true , [ 410 ]= true , [ 411 ]= true , [ 412 ]= true , [ 415 ]= true , [ 419 ]= true , [ 422 ]= true , [ 423 ]= true , [ 424 ]= true ,
[ 429 ]= true , [ 434 ]= true , [ 436 ]= true , [ 439 ]= true , [ 444 ]= true , [ 451 ]= true , [ 467 ]= true , [ 474 ]= true , [ 475 ]= true , [ 477 ]= true , [ 478 ]= true , [ 480 ]= true ,
[ 489 ]= true , [ 491 ]= true , [ 494 ]= true , [ 495 ]= true , [ 496 ]= true , [ 500 ]= true , [ 502 ]= true , [ 503 ]= true , [ 504 ]= true , [ 505 ]= true , [ 506 ]= true , [ 508 ]= true ,
[ 517 ]= true , [ 518 ]= true , [ 525 ]= true , [ 526 ]= true , [ 527 ]= true , [ 533 ]= true , [ 534 ]= true , [ 535 ]= true , [ 536 ]= true , [ 541 ]= true , [ 542 ]= true , [ 543 ]= true ,
[ 545 ]= true , [ 549 ]= true , [ 552 ]= true , [ 554 ]= true , [ 555 ]= true , [ 558 ]= true , [ 559 ]= true , [ 562 ]= true , [ 565 ]= true , [ 568 ]= true , [ 574 ]= true , [ 575 ]= true ,
[ 576 ]= true , [ 587 ]= true , [ 589 ]= true , [ 600 ]= true , [ 602 ]= true , [ 603 ]= true , [ 400 ]= true , [ 404 ]= true , [ 405 ]= true , [ 409 ]= true , [ 413 ]= true , [ 418 ]= true , [ 420 ]= true , [ 421 ]= true , [ 426 ]= true , [ 428 ]= true , [ 431 ]= true , [ 438 ]= true , [ 440 ]= true , [ 442 ]= true ,
[ 445 ]= true , [ 458 ]= true , [ 459 ]= true , [ 466 ]= true , [ 467 ]= true , [ 470 ]= true , [ 479 ]= true , [ 482 ]= true , [ 483 ]= true , [ 492 ]= true , [ 507 ]= true , [ 516 ]= true , [ 529 ]= true , [ 540 ]= true , [ 546 ]= true , [ 547 ]= true ,
[ 550 ]= true , [ 551 ]= true , [ 560 ]= true , [ 561 ]= true , [ 566 ]= true , [ 567 ]= true , [ 579 ]= true , [ 580 ]= true ,
}
function prawojazdy ( thePlayer , seat , jacked )
if ( not isCar [ getElementModel ( source )]) then return end
local playeraccount = getPlayerAccount ( thePlayer )
if seat == 0 then
if not getAccountData ( playeraccount , "prawojazdy" ) then
outputChatBox ( "Nie posiadasz prawa jazdy kategorii B lub zosta?o ono cofni?te!" , thePlayer , 255 , 255 , 255 , true )
cancelEvent ()
end
end
end
addEventHandler ( "onVehicleStartEnter" , getRootElement (), prawojazdy )
Ostatnio zmieniony przez Dexnes_ 2018-03-14, 17:14, w całości zmieniany 1 raz
Wysłany: 2018-03-14, 16:54
NyAngel
Wiek: 22 Na forum: 3950 dni Posty: 128
Nick w MP: NyAngel
Piwa : 556
"guciopl5" napisał/a :
S? jakie? b??dy w db3?
Ostatnio zmieniony przez Dexnes_ 2018-03-14, 17:15, w całości zmieniany 1 raz
Wysłany: 2018-03-14, 16:55
guciopl5
Wiek: 23 Na forum: 3146 dni Posty: 86
Nick w MP: Whit3
Piwa : 8
znaczy ja sie nie znam ogl zbyt dobrze ale dodam ze jak byl sam marker na powierzchni nie w int to dzia?a?o poprawnie
dopiero jak przenios?em to zaczelo sie tak dziac
Wysłany: 2018-03-14, 16:57
MichalskY
Wiek: 31 Na forum: 3405 dni Posty: 24
Po przedstawionych screenach mo?na wywnioskowa? ?e nie respi Ci? w interiorze 0. Tak jak by? by? ca?y czas w interiorze w kt?rym wchodzi?e? w marker
Ostatnio zmieniony przez MichalskY 2018-03-14, 16:57, w całości zmieniany 1 raz
Wysłany: 2018-03-14, 16:57
NyAngel
Wiek: 22 Na forum: 3950 dni Posty: 128
Nick w MP: NyAngel
Piwa : 556
"guciopl5" napisał/a :znaczy ja sie nie znam ogl zbyt dobrze ale dodam ze jak byl sam marker na powierzchni nie w int to dzia?a?o poprawnie
dopiero jak przenios?em to zaczelo sie tak dziac
A s? jakie? b??dy w ./debugscript 3 ?
Wysłany: 2018-03-14, 16:57
guciopl5
Wiek: 23 Na forum: 3146 dni Posty: 86
Nick w MP: Whit3
Piwa : 8
hmm a jak moge to naprawic ?
[ Dodano : 2018-03-14, 16:58 ]
moze urzad ktory mam ma inny int wpisany znaczy albo ma albo nie ma
[ Dodano : 2018-03-14, 16:58 ]
znaczy ja robie taki serwerek testowy jeszcze niemam oficjalnego serwera ...
[ Dodano : 2018-03-14, 17:00 ]
moze dam jeszcze linijki z urzedu ?
Wysłany: 2018-03-14, 17:10
NyAngel
Wiek: 22 Na forum: 3950 dni Posty: 128
Nick w MP: NyAngel
Piwa : 556
Marker pokazuje normalnie w urz?dzie?, bo jak u siebie wrzuci?em to nie pokazuje i kod dzia?a wi?c nie wiem.
local prawko = createMarker ( 359.00 , 164.37 , 1008.38 - 1 , "cylinder" , 1.5 , 0 , 125 , 125 , 255 )
setElementInterior ( prawko , 3 )
Jedynie to zmieni?em bo nie pokazywa?o mi markeru w urz?dzie.
Wysłany: 2018-03-14, 17:11
guciopl5
Wiek: 23 Na forum: 3146 dni Posty: 86
Nick w MP: Whit3
Piwa : 8
a ja patrzalem urzad i przy markerze wejscia jest int 3 a przy wyjscia 0 tak powinno byc?
[ Dodano : 2018-03-14, 17:12 ]
[quote][/quote]
no tak
[ Dodano : 2018-03-14, 17:12 ]
a mi pokazuje
Wysłany: 2018-03-14, 17:13
NyAngel
Wiek: 22 Na forum: 3950 dni Posty: 128
Nick w MP: NyAngel
Piwa : 556
"guciopl5" napisał/a :a ja patrzalem urzad i przy markerze wejscia jest int 3 a przy wyjscia 0 tak powinno byc?
[ Dodano : 2018-03-14, 17:12 ]
[quote][/quote]
no tak
[ Dodano : 2018-03-14, 17:12 ]
a mi pokazuje
Tak
Wysłany: 2018-03-14, 17:14
guciopl5
Wiek: 23 Na forum: 3146 dni Posty: 86
Nick w MP: Whit3
Piwa : 8
to nwm
[ Dodano : 2018-03-14, 17:14 ]
moze ten urzad cos psuje
Wysłany: 2018-03-14, 17:16
NyAngel
Wiek: 22 Na forum: 3950 dni Posty: 128
Nick w MP: NyAngel
Piwa : 556
Mi prawo jazdy dzia?a, wi?c nie wiem.
Wysłany: 2018-03-14, 17:20
guciopl5
Wiek: 23 Na forum: 3146 dni Posty: 86
Nick w MP: Whit3
Piwa : 8
hmm a jak wgralem inny urzad to teraz nie pokazuje markera w nim
Wysłany: 2018-03-14, 19:46
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Bo mo?e urz?d ma inny dimension/interior i inne wsp??rz?dne XYZ?
Tagi: prawo :: jazdy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: