Wysłany: 2016-05-27, 09:04
Basil.
Wiek: 24 Na forum: 3723 dni Posty: 80
Nick w MP: njefjem
Witam, elo, cze??, siemanko z tej strony mi?y, serdeczny i zawsze u?miechni?ty Basil, dobra koniec ?art?w. Mam skrypt na prawko, kt?ry kupi?em od pewnego skryptera, ale jak zmienie koordynaty to nie ma markera w kt?rym rozpoczynamy zdawanie.
Cz??? skryptu:
Kod: local prawko = createMarker(-2026.5999755859,-101.5,34.099998474121, "cylinder", 1.5, 255, 0, 255)
setElementDimension(prawko, 0)
setElementInterior(prawko, 0)
local punktyJazdy = {
{-2062.1000976563,-70.199996948242,34.200000762939},
{-2164.1000976563,-69.599998474121,34.200000762939},
{-2165,43.700000762939,34.200000762939},
{-2153.3000488281,107.69999694824,34.200000762939}
{-2098.1999511719,107.69999694824,34.200000762939
{-2013.0999755859,106.19999694824,26.5}
{-2009.9000244141,36.700000762939,31.799999237061}
{-2009.5999755859,-50,34.200000762939}
{-2042.4000244141,-67.699996948242,34.200000762939}
}
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
local konto = getPlayerAccount (el)
if getAccountData(konto, "prawojazdy") or getAccountData(konto, "prawkozakaz") then
outputChatBox("Posiadasz ju? prawo jazdy lub masz zakaz prowadzenia pojazd?w.", el)
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, -2047.1999511719,-95.900001525879,34.900001525879,0.0,0.0,0.0)
setElementData(pojazd, "pojazd_przebieg", math.random(10000, 20000))
setElementData(pojazd, "pojazd_paliwo", math.random(50,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, -2032.4000244141,-98.699996948242,34.099998474121)
Wysłany: 2016-05-27, 09:21
Atroth
Wiek: 23 Na forum: 3677 dni Posty: 1089
Nick w MP: Atroth
Piwa : 4808
Zwi?ksz jego pozycj? Z w tym przypadku:
Mo?esz zmieni? na"
Mo?e po prostu marker jest w ziemi.
Podpis
Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018
Wysłany: 2016-05-27, 09:26
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Jest jeszcze jeden b??d . Pogubi?e? nawiasy {} i przecinki .
local punktyJazdy = {
{- 2062.1000976563 ,- 70.199996948242 , 34.200000762939 },
{- 2164.1000976563 ,- 69.599998474121 , 34.200000762939 },
{- 2165 , 43.700000762939 , 34.200000762939 },
{- 2153.3000488281 , 107.69999694824 , 34.200000762939 },
{- 2098.1999511719 , 107.69999694824 , 34.200000762939 },
{- 2013.0999755859 , 106.19999694824 , 26.5 },
{- 2009.9000244141 , 36.700000762939 , 31.799999237061 },
{- 2009.5999755859 ,- 50 , 34.200000762939 },
{- 2042.4000244141 ,- 67.699996948242 , 34.200000762939 },
}
Prosz? poprawiony kod
Podpis
Uczeń LUA . Mapper MTA.
Tagi: robię :: źle?
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: