Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local vehID = 1
- local kradziez = {
- pojazdy = {
- zwykle = {
- {589, 526, 587, 603, 475, 489},
- },
- premium = {
- {411, 506, 451, 560, 477, 559}
- },
- pozycje = {
- {1404.42, -2262.15, 13.01, 178.5},
- {2055.68, -1903.58, 13.03, 3.1},
- {2185.34, -1807.02, 12.82, 177.9},
- {2464.05, -1546.45, 23.48, 87.4},
- {2217.62, -1166.49, 25.21, 92.0},
- {2810.01, -1826.26, 9.41, 268.2},
- {1672.57, 1286.74, 10.28, 358.7},
- {2602.52, 1836.45, 10.31, 90.1},
- {2186.26, 1996.56, 10.31, 267.4},
- {1692.34, 2053.96, 10.73, 90.4},
- {1338.19, 326.24, 19.49, 245.4},
- {2397.03, -47.95, 26.70, 182.1},
- {311.22, -1808.01, 3.91, 179.0},
- {396.21, -2017.55, 7.27, 88.6},
- ---{1928.81,-1092.22,24.26,84.0},
- {1575.87, -1010.93, 23.39, 358.5},
- {2229.97, -1344.83, 23.47, 270.2},
- {2390.56, -1488.08, 23.31, 89.8},
- },
- },
- dziuple = {
- {2741.31, -2001.45, 13.04, 265.9},
- {1894.65, -1990.73, 13.03, 271.0},
- },
- wiadomosci = {
- {"KtoĹ› kradnie pojazd!"},
- {"Ktoś ukradł mój pojazd!"},
- {"Doszło do kradzieży, ktoś odjeżdża moim autem!"},
- }
- }
- local function getPlayersByData(dataName, dataValue)
- local playersTable = {}
- for i,v in ipairs(getElementsByType("player")) do
- if getElementData(v, dataName) and getElementData(v, dataName) == "Policja" then
- table.insert(playersTable, v)
- end
- end
- return playersTable
- end
- local marker = createMarker(0, 0, -100, "cylinder", 4, 255,0,0,100 )
- local col = createColSphere(0, 0, -100, 1.7)
- local nagroda
- function stworzPojazd()
- local pojazd = math.random(1, 6)
- if pojazd >= 4 then
- vehicleModel = kradziez.pojazdy.premium
- nagroda = 25000
- else
- vehicleModel = kradziez.pojazdy.zwykle
- nagroda = 15000
- end
- local pozycja = math.random(1, #kradziez.pojazdy.pozycje)
- local dziupla = math.random(1, #kradziez.dziuple)
- local wiadomosc = math.random(1, #kradziez.wiadomosci)
- local model,x,y,z,rx,ry,rz = vehicleModel[1][pojazd], kradziez.pojazdy.pozycje[pozycja][1], kradziez.pojazdy.pozycje[pozycja][2], kradziez.pojazdy.pozycje[pozycja][3]+0.3, 0, 0,kradziez.pojazdy.pozycje[pozycja][4]
- --setElementPosition(marker, kradziez.dziuple[dziupla][1], kradziez.dziuple[dziupla][2], kradziez.dziuple[dziupla][3])
- exports.DB:zapytanie(string.format("UPDATE lss_vehicles SET model=%d, przechowalnia=0, hp=1000, loc='"..x..","..y..","..z.."', rot='"..rx..","..ry..","..rz.."', przebieg=0, bak=25, locked=1, frozen=1, opis='(( "..getVehicleNameFromModel( model ).." ))' WHERE id=%d", model, vehID))
- exports["lss-vehicles"]:veh_reload(vehID)
- for i,v in ipairs(getElementsByType("vehicle")) do
- local dbid=getElementData(v,"dbid")
- if getElementData( v, "dbid" ) == "1" then
- setElementData(v, "veh:gangkradziez:nagroda", nagroda)
- setElementData(v, "veh:gangkradziez:locked", true)
- attachElements( col, v )
- fixVehicle( v )
- end
- end
- for k, gangus in ipairs(getElementsByType("player")) do
- local character = getElementData(gangus, "character")
- if (character.co_id) then
- for i,v in ipairs(getElementsByType("vehicle")) do
- local dbid=getElementData(v,"dbid")
- if getElementData( v, "dbid" ) == "1" then
- local blip = createBlipAttachedTo(v, 41, 2, 255, 255, 255, 255, 0, 99999.0, gangus )
- cTimer = setTimer( function ()
- destroyElement( v )
- outputChatBox("Czas na dotarcie do pojazdu minął, event zakończony.", gangus, 255,0,0) -- DODAC USUWANIE BLIPA
- end, 15*60000, 1 )
- end
- end
- outputChatBox("W "..getZoneName( kradziez.pojazdy.pozycje[pozycja][1], kradziez.pojazdy.pozycje[pozycja][2], kradziez.pojazdy.pozycje[pozycja][3], true ).." w okolicach "..getZoneName( kradziez.pojazdy.pozycje[pozycja][1], kradziez.pojazdy.pozycje[pozycja][2], kradziez.pojazdy.pozycje[pozycja][3] ).." pojawił się pojazd "..getVehicleNameFromModel(vehicleModel[1][pojazd]).. ", za który możemy zgarnąć łatwy hajs. Ukradnij go i przewieź do dziupli, uważaj na policję.", gangus, 255,0,0)
- outputChatBox("(( Pojazd oraz dziupla zostały oznaczone na mapie, po ukradnięciu pojazdu policja otrzyma zawiadomienie o kradzieży ))", gangus)
- end
- end
- end
- addEventHandler("onVehicleStartEnter", root, function( kto, seat)
- local poj = source
- if getElementData(source, "dbid") == "1" then
- local character = getElementData(kto, "character")
- if (character.co_id) then
- if seat == 0 then
- if isVehicleLocked( source ) then
- cancelEvent()
- if isElementWithinColShape( kto, col ) then
- if isTimer(cTimer) then killTimer( cTimer ) end
- setPedAnimation ( kto, "CASINO", "dealone", 5000, true, false, false, false )
- setTimer(function () setVehicleLocked(poj, false) outputChatBox("(( Udało Ci się otworzyć zamek. ))", kto) setElementData(poj, "veh:gangkradziez:locked", false) end, 5000, 1)
- else
- outputChatBox("(( PodejdĹş do drzwi kierowcy. ))", kto)
- end
- end
- end
- end
- end
- end)
- addEventHandler("onVehicleEnter", root, function( kto, seat)
- local poj = source
- if getElementData(source, "dbid") == "1" then
- if seat ~= 0 then return end
- local character = getElementData(kto, "character")
- if (character.co_id) then
- if character.co_id == 6 then
- setElementPosition(marker,1883.16,-1983.38,12.5)
- elseif character.co_id == 5 then
- setElementPosition(marker,2750.65,-2002.26,12.5)
- else
- local dziupla = math.random(1, #kradziez.dziuple)
- setElementPosition(marker,kradziez.dziuple[dziupla][1], kradziez.dziuple[dziupla][2], kradziez.dziuple[dziupla][3])
- end
- local markerBlip = createBlipAttachedTo( marker, 24, 2, 255, 255, 255, 255, 0, 99999, kto)
- outputChatBox("Dostarcz pojazd do dziupli. Bądź ostrożny, policja otrzymała zawiadomienie o kradzieży.", kto, 255,0,0)
- outputChatBox("(( Dziupla jest oznaczona blipem 'D'. ))", kto)
- oTimer = setTimer( function ( )
- chuj, ile = getTimerDetails(oTimer)
- for k, gangus in ipairs(getElementsByType("player")) do
- local character = getElementData(gangus, "character")
- if (character.co_id) == 5 or (character.co_id) == 6 then
- outputChatBox("(( Czas na dostarczenie pojazdu do dziupli: "..ile.." minut. ))", gangus)
- end
- end
- end, 10*6000, 10 )
- vehTimer = setTimer( function ()
- for k, gangus in ipairs(getElementsByType("player")) do
- local character = getElementData(gangus, "character")
- if (character.co_id) == 5 or (character.co_id) == 6 then
- outputChatBox("(( Czas na dostarczenie pojazdu do dziupli minÄ…Ĺ‚. )).", gangus)
- outputChatBox("Nie zdążyliście na czas, pojazd przepadł.", gangus, 255,0,0)
- if getElementData(poj, "veh:blippd") ~= false then destroyElement( getElementData(poj, "veh:blippd") ) end
- for k,v in ipairs(getAttachedElements(marker)) do
- destroyElement(v)
- end
- for k,v in ipairs(getAttachedElements(poj)) do
- destroyElement(v)
- end
- destroyElement( marker )
- --destroyElement( col )
- destroyElement( poj )
- end
- end
- end, 10*60050, 1 )
- end
- end
- end)
- addEventHandler("onMarkerHit", marker, function( kto )
- if getElementType( kto ) == "vehicle" then
- if getElementData(kto, "dbid") == "1" then
- local kierowca = getVehicleOccupant( kto, 0 )
- if kierowca then
- local character = getElementData(kierowca, "character")
- if (character.co_id) then
- if (character.co_id) == 5 then
- local nagrodaa = 120 -- tonumber(getElementData(kto, "veh:gangkradziez:nagroda"))+math.random(1337,2137)
- exports["lss-pojemniki"]:insertItemToContainer(14733, -1, 11, 0, "GotĂłwka")
- else
- exports["lss-pojemniki"]:insertItemToContainer(14094, -1, 11, 0, "GotĂłwka")
- end
- outputChatBox("Brawo! Dobra robota, udało Ci się dostarczyć pojazd do dziupli. Za tę robotę zgarneliśmy: chuj$!", kierowca, 255,0,0)
- outputChatBox("(( GotĂłwka dodana do sejfu organizacji. ))", kierowca)
- if isTimer( oTimer ) then killTimer( oTimer ) end
- if isTimer( vehTimer ) then killTimer( vehTimer ) end
- if getElementData(kto, "veh:blippd") ~= false then destroyElement( getElementData(kto, "veh:blippd") ) end
- for k,v in ipairs(getAttachedElements(marker)) do
- destroyElement(v)
- end
- for k,v in ipairs(getAttachedElements(kto)) do
- destroyElement(v)
- end
- destroyElement( kto )
- destroyElement( marker )
- end
- end
- end
- end
- end)
- addEventHandler("onVehicleExplode", root, function( kto )
- local vehs = source
- if getElementData(source, "dbid") == "1" then
- if isTimer( oTimer ) then killTimer( oTimer ) end
- if isTimer( vehTimer ) then killTimer( vehTimer ) end
- if getElementData(source, "veh:blippd") ~= false then destroyElement( getElementData(source, "veh:blippd") ) end
- for k,v in ipairs(getAttachedElements(marker)) do
- destroyElement(v)
- end
- for k,v in ipairs(getAttachedElements(source)) do
- destroyElement(v)
- end
- destroyElement( col )
- destroyElement( marker )
- setTimer( function () destroyElement( vehs ) end, 60000, 1 )
- for k, gangus in ipairs(getElementsByType("player")) do
- local character = getElementData(gangus, "character")
- if (character.co_id) then
- if (character.co_id) == 5 or (character.co_id) == 6 then
- outputChatBox("(( Event zakończony, pojazd wybuchł. )))", gangus) -- CENA DODAC
- end
- end
- end
- end
- end)
- stworzPojazd()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement