Chodzi mi o to:
-Zrobienie marker?w z kt?rych bierze si? pojazdy
to ju? mam ,ale jak zrobie powy?ej 2 to znikaj? mi markery ,musze to jako? inaczej zapisa? czy co?
-Aby pojazdy z markera znika?y po 10 min jak si? ich nie u?ywa
tak wygl?da skrypt
-- // Ustawienia lokalne dotycz?ce tabeli & tworzenia pojazdu \\ --
stworzPojazd = createMarker ( -821.90, 1890.5, 5.40, "cylinder", 3, 255 ,96, 0, 255 ) -- uzupe?nij pozycje markeru
tabelaPojazd = {}
-- // Funkcja na tworzenie pojazdu oraz sprawdzanie czy gracz wjecha? pojazdem, czy wszed? bez pojazdu\\ --
function tworzeniePojazdu (hitElement)
if ( isElement(hitElement) and getElementType(hitElement) == 'player' ) then
local pojazdElement = getPedOccupiedVehicle(hitElement)
if ( pojazdElement ) then
if ( tabelaPojazd[hitElement] ) then
destroyElement(pojazdElement)
tabelaPojazd[hitElement] = nil
outputChatBox ("Tw?j Pojazd Zosta? Schowany!", hitElement, 255, 255, 255)
return
end
end
-- // Cz??? funkcji tworz?cej pojazd dla gracza, od razu teleportuje do ?rodka pojazdu \\ --
local x, y, z = getElementPosition (hitElement) -- tutaj nic nie zmieniasz, gdy? okre?la pozycj? gracza i na jego miejscu tworzy pojazd
local rotX, rotY, rotZ = getElementRotation (hitElement)
tabelaPojazd[hitElement] = createVehicle ( 433, -811.20,1892.40,7.19)
setElementRotation (tabelaPojazd[hitElement], rotX, rotY, 282.5)
warpPedIntoVehicle (hitElement, tabelaPojazd[hitElement])
outputChatBox ("Dosta?e?(a?) Pojazd!", hitElement, 255, 255, 255)
end
end
addEventHandler("onMarkerHit", stworzPojazd, tworzeniePojazdu)
---Swat
stworzPojazd = createMarker ( -822.5, 1900.09, 5.40, "cylinder", 3, 255 ,96, 0, 255 ) -- uzupe?nij pozycje markeru
tabelaPojazd = {}
-- // Funkcja na tworzenie pojazdu oraz sprawdzanie czy gracz wjecha? pojazdem, czy wszed? bez pojazdu\\ --
function tworzeniePojazdu (hitElement)
if ( isElement(hitElement) and getElementType(hitElement) == 'player' ) then
local pojazdElement = getPedOccupiedVehicle(hitElement)
if ( pojazdElement ) then
if ( tabelaPojazd[hitElement] ) then
destroyElement(pojazdElement)
tabelaPojazd[hitElement] = nil
outputChatBox ("Tw?j Pojazd Zosta? Schowany!", hitElement, 255, 255, 255)
return
end
end
-- // Cz??? funkcji tworz?cej pojazd dla gracza, od razu teleportuje do ?rodka pojazdu \\ --
local x, y, z = getElementPosition (hitElement) -- tutaj nic nie zmieniasz, gdy? okre?la pozycj? gracza i na jego miejscu tworzy pojazd
local rotX, rotY, rotZ = getElementRotation (hitElement)
tabelaPojazd[hitElement] = createVehicle ( 601, -815.09,1901.69,6.80 )
setElementRotation (tabelaPojazd[hitElement], rotX, rotY, 282.5)
warpPedIntoVehicle (hitElement, tabelaPojazd[hitElement])
outputChatBox ("Dosta?e?(a?) Pojazd!", hitElement, 255, 255, 255)
end
end
addEventHandler("onMarkerHit", stworzPojazd, tworzeniePojazdu)
|