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
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!
Wysłany: 2016-03-11, 16:42
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
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
Wicek7 , mo?esz jako? si? rozpisa??
Podpis
[you]
, pomogłem Ci? Wynagrodź mnie
Wysłany: 2016-03-11, 16:45
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
Oczywi?cie
createBlipAttachedTo ( zmienna_markera , id_blipu )
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
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
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
[you]
, pomogłem Ci? Wynagrodź mnie
Wysłany: 2016-03-11, 16:50
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
Nie trzeba akurat tak , dam Ci przyk?ad a ty przerobisz to pod siebie
cel = createMarker ( x , y , z , "cylinder" , 4.0 , 255 , 100 , 100 ) ------ Jaki ? tam marker
blip = createBlipAttachedTo ( cel , 41 ) --------- Robimy do tego blip
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
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
Wicek7 , chyba mnie nie rozumiesz...
chc? ?eby w by? blip gdzie si? znajduje dany checkpoint, co? co??
Podpis
[you]
, pomogłem Ci? Wynagrodź mnie
Wysłany: 2016-03-11, 16:53
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
No to poda?em tobie przyk?ad
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
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
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
[you]
, pomogłem Ci? Wynagrodź mnie
Wysłany: 2016-03-11, 16:59
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
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
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
Wicek7 , da? ca?y kod c-side czy s-side?
Podpis
[you]
, pomogłem Ci? Wynagrodź mnie
Wysłany: 2016-03-11, 17:02
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
c-side starczy.
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
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
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
[you]
, pomogłem Ci? Wynagrodź mnie
Wysłany: 2016-03-11, 17:12
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
Prosz?.
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 ])
blip = createBlipAttachedTo ( jobMarker , 41 )
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
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
Wicek7 , Dzi?ki
[ Dodano : 2016-03-11, 17:24 ]
Do zamkni?cia
Podpis
[you]
, pomogłem Ci? Wynagrodź mnie
Tagi: blip :: danego :: celu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: