Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2017-11-28, 16:20


alentari12







Wiek: 47
Na forum: 3142 dni
Posty: 8



Respekt: 50

Witam mam problem z markerami odno?nie chcia?bym by dla L i H by?y ustawione Ringi a dla A B C checkpoint
Kod:

function finishLicense(value)
if isElement(licenseMarker) and licenseMarker then
destroyElement(licenseMarker)
licenseMarker=nil
end
if isElement(licenseBlip) and licenseBlip then
destroyElement(licenseBlip)
licenseBlip=nil
end
if value == true then
licenseCategory=nil
licenseVehicle=nil
licenseMarker=nil
licenseTarget=nil
licenseBlip=nil
end
end
addEvent("license:finish",true)
addEventHandler("license:finish", resourceRoot, finishLicense)

function showMarker()
local pos=categoryPositions[licenseCategory][licenseTarget]
if licenseCategory ~= "L, H" then
licenseMarker=createMarker(pos[1], pos[2], pos[3], "ring", 3, 0, 0, 255, 155)
else
licenseMarker=createMarker(pos[1], pos[2], pos[3], "checkpoint", 2, 43, 154, 211, 255)
end
licenseBlip=createBlip(pos[1], pos[2], pos[3], 0, 1, 255, 0, 0)
if categoryPositions[licenseCategory][licenseTarget+1] then
e=categoryPositions[licenseCategory][licenseTarget+1]
setMarkerTarget(licenseMarker, e[1], e[2], e[3])
end
addEventHandler("onClientMarkerHit", licenseMarker, function(el,md)
if not md or el~=localPlayer then return end
if not getPedOccupiedVehicle(el) then return end
if licenseTarget < #categoryPositions[licenseCategory] then
local sound=playSound(":ogrpg-misc/misc/point.wav")
setSoundVolume(sound, 1.0)

finishLicense(false)
licenseTarget=licenseTarget+1
showMarker()
else
local sound=playSound(":ogrpg-misc/misc/success.flac")
setSoundVolume(sound, 1.0)

outputChatBox("* Zda?e?(a?) egzamin. Gratulacje!")
setPedCanBeKnockedOffBike(localPlayer, true)
triggerServerEvent("license:vehdel", resourceRoot, licenseVehicle)
setElementData(localPlayer,"player:license:pj"..licenseCategory, 1)
finishLicense(true)
triggerServerEvent("warp:graczaurzod", localPlayer)
end
end)
end

addEvent("license:start",true)
addEventHandler("license:start", resourceRoot, function(category,vehicle)
licenseTarget=1
licenseBlip=nil
licenseMarker=nil
licenseCategory=category
licenseVehicle=vehicle
showMarker()
setPedCanBeKnockedOffBike(localPlayer, false)
end)

punkty={}

function nalicz()
local veh=getPedOccupiedVehicle(localPlayer)
if not veh then return end
local x,y,z=getElementPosition(veh)
table.insert(punkty, {x,y,z})
outputChatBox("* Dodano")
end

addCommandHandler("zakoncz", function()
for i,v in ipairs(punkty) do
lol=string.format("{%.02f, %.02f, %.02f},", v[1], v[2], v[3])
outputChatBox(" "..lol)
killTimer(punkty_timer)
end
end)

addCommandHandler("licz", function()
outputChatBox("* Rozpocz??e?(a?) naliczanie, aby zako?czy? wpisz /zakoncz")
punkty_timer=setTimer(nalicz, 3000, 0)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-28, 17:46


kajetan254







Wiek: 28
Na forum: 3184 dni
Posty: 42
Nick w MP: Kajetan

Piwa: 93

Respekt: 60

Podaj kod w kt?rym masz ustawione checpointy

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-29, 00:17


alentari12







Wiek: 47
Na forum: 3142 dni
Posty: 8



Respekt: 50

Kod:

local licenseBlip
local licenseTarget
local licenseMarker
local licenseVehicle
local licenseCategory
local licenseCategory2

local categoryPositions={
["A"]={
{-1725.47,752.60,24.41},
{-1717.29,714.98,24.25},
{-1717.56,664.37,24.26},
{-1762.98,609.24,26.93},
{-1831.40,608.99,34.53},
{-1921.02,608.71,34.54},
{-1992.00,609.27,34.56},
{-2007.06,580.78,34.53},
{-2030.45,568.88,34.53},
{-2127.47,568.67,34.53},
{-2146.47,531.59,34.53},
{-2110.21,502.25,34.53},
{-2031.75,502.69,34.53},
{-2007.89,487.05,34.53},
{-2008.15,364.19,34.53},
{-1979.95,342.72,34.13},
{-1914.52,338.17,29.77},
{-1878.73,381.03,19.89},
{-1845.45,427.45,16.53},
{-1833.55,521.79,32.03},
{-1895.33,586.81,34.45},
{-1851.82,602.73,34.53},
{-1787.28,601.91,31.32},
{-1711.50,644.03,24.25},
{-1711.14,715.04,24.26},
{-1711.46,770.96,24.25},
{-1735.05,789.42,24.41},
},
["A1"]={
{-1725.47,752.60,24.41},
{-1717.29,714.98,24.25},
{-1717.56,664.37,24.26},
{-1762.98,609.24,26.93},
{-1831.40,608.99,34.53},
{-1921.02,608.71,34.54},
{-1992.00,609.27,34.56},
{-2007.06,580.78,34.53},
{-2030.45,568.88,34.53},
{-2127.47,568.67,34.53},
{-2146.47,531.59,34.53},
{-2110.21,502.25,34.53},
{-2031.75,502.69,34.53},
{-2007.89,487.05,34.53},
{-2008.15,364.19,34.53},
{-1979.95,342.72,34.13},
{-1914.52,338.17,29.77},
{-1878.73,381.03,19.89},
{-1845.45,427.45,16.53},
{-1833.55,521.79,32.03},
{-1895.33,586.81,34.45},
{-1851.82,602.73,34.53},
{-1787.28,601.91,31.32},
{-1711.50,644.03,24.25},
{-1711.14,715.04,24.26},
{-1711.46,770.96,24.25},
{-1735.05,789.42,24.41},
},

["C"]={
{-1725.47,752.60,24.41},
{-1717.29,714.98,24.25},
{-1717.56,664.37,24.26},
{-1762.98,609.24,26.93},
{-1831.40,608.99,34.53},
{-1921.02,608.71,34.54},
{-1992.00,609.27,34.56},
{-2007.06,580.78,34.53},
{-2030.45,568.88,34.53},
{-2127.47,568.67,34.53},
{-2146.47,531.59,34.53},
{-2110.21,502.25,34.53},
{-2031.75,502.69,34.53},
{-2007.89,487.05,34.53},
{-2008.15,364.19,34.53},
{-1979.95,342.72,34.13},
{-1914.52,338.17,29.77},
{-1878.73,381.03,19.89},
{-1845.45,427.45,16.53},
{-1833.55,521.79,32.03},
{-1895.33,586.81,34.45},
{-1851.82,602.73,34.53},
{-1787.28,601.91,31.32},
{-1711.50,644.03,24.25},
{-1711.14,715.04,24.26},
{-1711.46,770.96,24.25},
{-1735.05,789.42,24.41},
},
["B"]={
{-1725.47,752.60,24.41},
{-1717.29,714.98,24.25},
{-1717.56,664.37,24.26},
{-1762.98,609.24,26.93},
{-1831.40,608.99,34.53},
{-1921.02,608.71,34.54},
{-1992.00,609.27,34.56},
{-2007.06,580.78,34.53},
{-2030.45,568.88,34.53},
{-2127.47,568.67,34.53},
{-2146.47,531.59,34.53},
{-2110.21,502.25,34.53},
{-2031.75,502.69,34.53},
{-2007.89,487.05,34.53},
{-2008.15,364.19,34.53},
{-1979.95,342.72,34.13},
{-1914.52,338.17,29.77},
{-1878.73,381.03,19.89},
{-1845.45,427.45,16.53},
{-1833.55,521.79,32.03},
{-1895.33,586.81,34.45},
{-1851.82,602.73,34.53},
{-1787.28,601.91,31.32},
{-1711.50,644.03,24.25},
{-1711.14,715.04,24.26},
{-1711.46,770.96,24.25},
{-1735.05,789.42,24.41},

},
["L"]={
{364.47, 2502.39, 16.48},
{403.86, 2504.79, 16.48},
{335.25, 2501.99, 16.48},
{239.15, 2502.35, 16.48},
{90.62, 2502.73, 41.68},
{-238.88, 2529.73, 85.98},
{=},
{-841.42, 2743.67, 124.98},
{-1486.03, 2720.13, 124.98},
{=},
{-2050.82, 2386.69, 124.98},
{-1916.94, 1863.44, 124.98},
{-1403.63, 1623.66, 55.48},
{-837.87, 1643.12, 63.78},
{-360.31, 1530.36, 129.98},
{251.33, 1575.00, 129.98},
{816.06, 1971.67, 129.98},
{576.67, 2499.54, 90.88},
{371.22, 2503.07, 51.88},
{190.72, 2503.68, 35.28},
{49.02, 2503.30, 24.18},
{-51.95, 2503.66, 16.48},
},
["H"]={
{73.50, 2504.66, 53.02},
{-244.68, 2584.81, 105.08},
{},
{-716.39, 1956.92, 107.78},
{=},
{-613.86, 996.16, 60.38},
{326.36, 967.45, 60.38},
{=},
{},
{753.61, -451.59, 126.98},
{=},
{-197.92, -856.46, 126.98},
{=},
{-1140.26, -566.27, 93.28},
{-1329.75, -282.85, 93.28},
{-=},
},
}

function finishLicense(value)
if isElement(licenseMarker) and licenseMarker then
destroyElement(licenseMarker)
licenseMarker=nil
end
if isElement(licenseBlip) and licenseBlip then
destroyElement(licenseBlip)
licenseBlip=nil
end
if value == true then
licenseCategory=nil
licenseVehicle=nil
licenseMarker=nil
licenseTarget=nil
licenseBlip=nil
end
end
addEvent("license:finish",true)
addEventHandler("license:finish", resourceRoot, finishLicense)

function showMarker()
local pos=categoryPositions[licenseCategory][licenseTarget]
if licenseCategory ~= "L, H" then
licenseMarker=createMarker(pos[1], pos[2], pos[3], "ring", 3, 0, 0, 255, 155)
else
licenseMarker=createMarker(pos[1], pos[2], pos[3], "checkpoint", 2, 43, 154, 211, 255)
end
licenseBlip=createBlip(pos[1], pos[2], pos[3], 0, 1, 255, 0, 0)
if categoryPositions[licenseCategory][licenseTarget+1] then
e=categoryPositions[licenseCategory][licenseTarget+1]
setMarkerTarget(licenseMarker, e[1], e[2], e[3])
end
addEventHandler("onClientMarkerHit", licenseMarker, function(el,md)
if not md or el~=localPlayer then return end
if not getPedOccupiedVehicle(el) then return end
if licenseTarget < #categoryPositions[licenseCategory] then
local sound=playSound(":ogrpg-misc/misc/point.wav")
setSoundVolume(sound, 1.0)

finishLicense(false)
licenseTarget=licenseTarget+1
showMarker()
else
local sound=playSound(":ogrpg-misc/misc/success.flac")
setSoundVolume(sound, 1.0)

outputChatBox("* Zda?e?(a?) egzamin. Gratulacje!")
setPedCanBeKnockedOffBike(localPlayer, true)
triggerServerEvent("license:vehdel", resourceRoot, licenseVehicle)
setElementData(localPlayer,"player:license:pj"..licenseCategory, 1)
finishLicense(true)
triggerServerEvent("warp:graczaurzod", localPlayer)
end
end)
end

addEvent("license:start",true)
addEventHandler("license:start", resourceRoot, function(category,vehicle)
licenseTarget=1
licenseBlip=nil
licenseMarker=nil
licenseCategory=category
licenseVehicle=vehicle
showMarker()
setPedCanBeKnockedOffBike(localPlayer, false)
end)

punkty={}

function nalicz()
local veh=getPedOccupiedVehicle(localPlayer)
if not veh then return end
local x,y,z=getElementPosition(veh)
table.insert(punkty, {x,y,z})
outputChatBox("* Dodano")
end

addCommandHandler("zakoncz", function()
for i,v in ipairs(punkty) do
lol=string.format("{%.02f, %.02f, %.02f},", v[1], v[2], v[3])
outputChatBox(" "..lol)
killTimer(punkty_timer)
end
end)

addCommandHandler("licz", function()
outputChatBox("* Rozpocz??e?(a?) naliczanie, aby zako?czy? wpisz /zakoncz")
punkty_timer=setTimer(nalicz, 3000, 0)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-29, 16:42


PreQ

Halo admin






Wiek: 29
Na forum: 3111 dni
Posty: 34
Nick w MP: Shikomaru

Piwa: 80

Respekt: 60

Tam gdzie chcesz mie? ring to dajesz
Kod:

createMarker ( x, y, z , "ring", 1.5, 255, 255, 255, 170 )


a tam gdzie checkpoint to dajesz
Kod:

createMarker ( x, y, z , "checkpoint", 1.5, 255, 255, 255, 170 )


*Tam gdzie jest x,y,z dajesz pozycje gdzie ten marker ma by?.*

Podpis
Mapper & Lua

Postaw piwo autorowi tego posta
 

 
Tagi: markery :: lickach
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Markery w lickach L, H Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku