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

Wysłany: 2016-03-11, 16:31


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Cze?? uporam si? nadal z kodem, chc? aby dalej by?y punkty tylko ?eby na mapie by? blip gdzie mamy dowie?? skrzynki a tam b?dzie checkpoint i daje nam kas?. (Otrzymywanie kasy ju? dzia?a, dzi?kuj? Emm:3 )

Kawa?ek kodu po stronie clienta wraz z punktami:

Kod:

local districtsBus = {
{-2546, 321, 19},
{-2791, 230, 7},
{-1982.232421875, 61.4873046875, 28.397748947144},
{-1975.87890625, 54.33984375, 28.820150375366},
{-1979.0498046875, 42.4169921875, 30.257034301758},
{-1987.0859375, 44.1552734375, 30.382406234741},

}

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


Prosz? o pomoc gdzie co wklei?, wynagradzam piwami! :P

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 16:42


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%

Więcej informacji znajdziesz w Wikipedii MTA:

createBlipAttachedTo


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 16:44


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Wicek7, mo?esz jako? si? rozpisa??

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 16:45


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
Oczywi?cie :)

createBlipAttachedTo(zmienna_markeraid_blipu)


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 16:48


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Wicek7, takie co??

Kod:

local districtsBus = {
{-2546, 321, 19, 12 --id blipa},
{-2791, 230, 7},
{-1982.232421875, 61.4873046875, 28.397748947144},
{-1975.87890625, 54.33984375, 28.820150375366},
{-1979.0498046875, 42.4169921875, 30.257034301758},
{-1987.0859375, 44.1552734375, 30.382406234741},


Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 16:50


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
Nie trzeba akurat tak , dam Ci przyk?ad a ty przerobisz to pod siebie :)


cel createMarker(x,y,z"cylinder"4.0255100100) ------ Jakitam marker
blip createBlipAttachedTo(cel41) --------- Robimy do tego blip


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 16:51


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Wicek7, chyba mnie nie rozumiesz...

chc? ?eby w by? blip gdzie si? znajduje dany checkpoint, co? co??

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 16:53


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
No to poda?em tobie przyk?ad :)

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 16:55


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Wicek7, dam kod pocz?tkowy pracy a co do checkpoint'?w to ci da?em

Kod:

addEvent("givePlayerMoney", true)
addEventHandler("givePlayerMoney", resourceRoot, function(m)
if tonumber(m) then
givePlayerMoney(client, m)
end
end)


createBlip (-2757, 170, 8, 52)
local m1 = createMarker(-2757, 170, 7, "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

--strona serwera

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 16:59


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
No niby da?e?... ale nie da?e? kawa?ka z tworzeniem markeru.

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 17:01


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Wicek7, da? ca?y kod c-side czy s-side?

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 17:02


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
c-side starczy.

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 17:06


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Wicek7,
Kod:

local districtsBus = {
{-2546, 321, 19},
{-2791, 230, 7},
{-1723, 782, 24},
{-2466, 781, 35},
{-2722, 982, 54},
{-1928, 1161, 45},

}

blip = createBlipAttachedTo(districtsBus, 41)
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
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 17:12


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
Prosz?.

function showMarker() 
if jobMarker and isElement(jobMarkerthen 
destroyElement(jobMarkerjobMarker nil 
end 

jobTarget jobTarget 1 
jobMarker createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint"400255) 

if districtsBus[jobTarget+1then 
ile districtsBus[jobTarget+1setMarkerTarget(jobMarkerile[1], ile[2], ile[3]) 
blip createBlipAttachedTo(jobMarker41)
end 


I potem do odpowiednich funkcji dodaj


destroyElement(blip) ------- Wy??czy blip


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 17:24


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Wicek7, Dzi?ki :)

[ Dodano: 2016-03-11, 17:24 ]
Do zamkni?cia

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Tagi: blip :: danego :: celu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Blip do danego celu 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