Emm
***** ***
Wiek: 32 Na forum: 3880 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Spr?buj tak
Strona serwera:
addEvent ( "givePlayerMoney" , true )
addEventHandler ( "givePlayerMoney" , resourceRoot , function( m )
if tonumber ( m ) then
givePlayerMoney ( client , m )
end
end )
createBlip (- 1992.65625 , 76.9609375 , 27.747310638428 , 52 )
local m1 = createMarker (- 1992.65625 , 76.9609375 , 27.747310638428 , "cylinder" , 4.0 , 255 , 0 , 0 )
vehs = {}
function removePreviousVehicles ( plr )
for i , v in ipairs ( getElementsByType ( "vehicle" , resourceRoot )) do
local sby = getElementData ( v , "zrespilGracz" )
if sby and sby == plr and getPedOccupiedVehicle ( plr ) ~= v then
destroyElement ( v )
end
end
end
addEventHandler ( "onMarkerHit" , m1 , function( el , md )
if getElementData ( el , "zrespilGracz" ) then
outputChatBox ( "praca w tworzeniu..." , el )
return
end
if not md or getElementType ( el ) ~= "player" or getPedOccupiedVehicle ( el ) then return end
local x , y , z = getElementPosition ( el )
local bus = createVehicle ( 597 , x , y , z ,- 1992.3388671875 , 75.3896484375 , 27.813388824463 )
setElementData ( bus , "zrespilGracz" , el )
setElementData ( bus , "pojazd_paliwo" , 50 )
setElementData ( bus , "pojazd_przebieg" , 100 )
warpPedIntoVehicle ( el , bus )
removePreviousVehicles ( el )
triggerClientEvent ( el , "STARTJobBus" , resourceRoot , bus )
vehs [ el ] = bus
end )
addEvent ( "STOPJobBus" , true )
addEventHandler ( "STOPJobBus" , resourceRoot , function()
local pojazd = getPedOccupiedVehicle ( localPlayer )
if pojazd then
destroyElement ( pojazd )
end
end )
addEvent ( "destroyVeh" , true )
addEventHandler ( "destroyVeh" , getRootElement (),
function()
if vehs [ source ] then
if isElement ( vehs [ source ]) then destroyElement ( vehs [ source ]) end
end
end )
Strona clienta:
local districtsBus = {
{
- 2054 , 136 , 28 },
{- 1987.7734375 , 66.0009765625 , 28.20802116394 },
{- 1982.232421875 , 61.4873046875 , 28.397748947144 },
{- 1975.87890625 , 54.33984375 , 28.820150375366 },
{- 1979.0498046875 , 42.4169921875 , 30.257034301758 },
{- 1987.0859375 , 44.1552734375 , 30.382406234741 },
{- 1992.884765625 , 42.53515625 , 31.611793518066 },
{- 1986.7724609375 , 39.0703125 , 31.022226333618 },
{- 1983.4111328125 , 35.2568359375 , 31.097345352173 },
{- 1978.9111328125 , 29.7802734375 , 31.77773475647 },
{- 1976.244140625 , 40.6865234375 , 30.465520858765 },
{- 1967.7197265625 , 50.033203125 , 29.339172363281 },
{- 1963.4794921875 , 60.6533203125 , 28.409980773926 },
{- 1963.546875 , 66.1484375 , 28.088659286499 },
{- 1968.9736328125 , 67.52734375 , 28.111268997192 },
{- 1968.015625 , 73.3701171875 , 27.749971389771 },
{- 1980.62890625 , 71.923828125 , 27.959045410156 },
{- 1992.4296875 , 69.5458984375 , 28.074096679688 },
{- 1993.462890625 , 64.068359375 , 28.889764785767 },
{- 1989.5576171875 , 56.416015625 , 29.259981155396 },
{- 1982.267578125 , 59.7333984375 , 28.471450805664 },
{- 1984.201171875 , 73.5771484375 , 27.889549255371 },
}
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 ( "** Rozpocz??e?/a? prac? spedytora, przetransportuj skrzynki do danego celu. " )
else
showMarker ()
playSoundFrontEnd ( 12 )
triggerServerEvent ( "givePlayerMoney" , resourceRoot , 150 )
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 ], "checkpoint" , 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? spedytora, przetransportuj skrzynki do danego celu." )
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? spedytora." )
end
end
end )
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 .