BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
Siemanko , gdzie moge doda? ten kod ? aby si? wy?wietla?a szcza?ka gdzie mamy jecha? ? do kt?rego markeru ;
addEventHandler ( 'onClientRender' , root ,
function ()
local rotation = getScreenRotationFromWorldPosition ( 0 , 0 , 0 )
dxDrawImage ( 100 , 100 , 100 , 100 , "arrow.png" , rotation )
end
)
a tutaj ten kod gdzie to dodac
--[[
@ copyright 2013 - 2014 Split < split @ go - life . pl >
@ author Split < split @ go - life . pl >
@ version 1.0 beta
@ changelog :
* Poprawiono prac ?.
Nie masz prawa u ? ywac tego kodu bez mojej zgody .
Napisz do mnie by ? mo ? e si ? zgodz ? na u ? ycie kodu .
]]--
local districtsBus = {
{ 1587.5682373047 , 1639.0322265625 , 9.90 },
{ 1522.6079101563 , 1630.0537109375 , 9.90 },
{ 1501.4533691406 , 1559.3776855469 , 9.90 },
{ 1551.7503662109 , 1498.5023193359 , 9.90 },
{ 1582.4689941406 , 1417.3887939453 , 9.90 },
{ 1572.2294921875 , 1342.3723144531 , 9.90 },
{ 1620.1942138672 , 1273.1031494141 , 9.90 },
{ 1577.0076904297 , 1229.8157958984 , 9.90 },
{ 1474.8508300781 , 1235.5185546875 , 9.90 },
{ 1397.1556396484 , 1277.6910400391 , 9.90 },
{ 1435.08984375 , 1399.2395019531 , 9.90 },
{ 1458.4331054688 , 1435.2819824219 , 9.90 },
{ 1460.69921875 , 1438.7807617188 , 9.90 },
{ 1508.1932373047 , 1518.2768554688 , 9.90 },
{ 1542.7019042969 , 1589.5841064453 , 9.90 },
{ 1603.6715087891 , 1644.4538574219 , 9.90 },
}
local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus
function finishJob ()
if jobMarker and isElement ( jobMarker ) then
destroyElement ( jobMarker )
jobMarker = nil
end
if jobTarget and isElement ( jobTarget ) then
destroyElement ( jobTarget )
jobTarget = nil
jobTarget = 0
end
triggerServerEvent ( "destroyVeh" , localPlayer )
end
function busDriver ( el , md )
if el ~= localPlayer or not md then return end
if jobTarget > maxTarget and getPedOccupiedVehicle ( el ) then return end
if jobTarget == maxTarget and not getPedOccupiedVehicle ( el ) then return end
if jobTarget == #districtsBus then
finishJob ()
playSoundFrontEnd ( 5 )
outputChatBox ( "* Zako?czy?e?/a? prac?." )
else
showMarker ()
playSoundFrontEnd ( 12 )
triggerServerEvent ( "giveGPoint" , root )
triggerServerEvent ( "givePlayerMoney" , el , 5 , 1 )
end
end
function showMarker ()
if jobMarker and isElement ( jobMarker ) then
destroyElement ( jobMarker )
jobMarker = nil
end
jobTarget = jobTarget + 1
jobMarker = createMarker ( districtsBus [ jobTarget ][ 1 ], districtsBus [ jobTarget ][ 2 ], districtsBus [ jobTarget ][ 3 ], "cylinder" , 4 , 0 , 0 , 255 )
if districtsBus [ jobTarget + 1 ] then
ile = districtsBus [ jobTarget + 1 ]
setMarkerTarget ( jobMarker , ile [ 1 ], ile [ 2 ], ile [ 3 ])
end
addEventHandler ( "onClientMarkerHit" , jobMarker , busDriver )
end
addEvent ( "STARTJobBus" , true )
addEventHandler ( "STARTJobBus" , resourceRoot , function( veh )
outputChatBox ( "* Rozpocz??e?/a? prac?." )
jobVehicle = veh
jobTarget = 0
showMarker ()
end )
addEventHandler ( "onClientResourceStop" , resourceRoot , function()
if jobVehicle and getElementData ( localPlayer , "gracz_praca" ) then
setElementData ( localPlayer , "gracz_praca" , false )
end
end )
addEventHandler ( "onClientVehicleExit" , resourceRoot , function( plr , seat )
if seat == 0 then
if plr == localPlayer then
finishJob ()
outputChatBox ( "* Zako?czy?e? prac?" )
end
end
end )