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

Wysłany: 2017-12-25, 19:03


NoKill1997

Online






Wiek: 28
Na forum: 3224 dni
Posty: 183
Nick w MP: Mefedroniarz.PDW

Piwa: 778

Respekt: 80,5

Witam mam problem z pewnym zasobem z tego forum. Chodzi mi mianowicie o to ze blip i marker "Cylinder" pokazuje sie kazdemu. Za pomoc w naprawie stawiam zimne :piwo: prosto z lodowki i daje R*
a oto kod:
--[[
Praca dostawcy
Skrypt napisany dlagtao.pl
AutorxMaXeRx
Prosz?™ o nie zmienianie autora.
W razie jakichkolwiek problemĂłw napisz do mnie:
SkypeFilip.Szulc85
GG60152565
--]]


ladowanie createMarker (2494.43,-1667.23,13.34-1"cylinder"5255,255,100100) --Marker do za?‚adowania pojazdu skrzynkami.

-- Pojazdy
local vehicles = { -- x,y,zrotxrotyrotzid
{2490.50854,-1680.10181,13.33654,0,0,01},
{2495.44263,-1681.39758,13.33895,0,0,02},
--{x,y,z,rx,ry,rz},
--{x,y,z,rx,ry,rz}
}

--Liczba 440 to id pojazdu moĹĽesz zamieni?‡ sobie na w?‚asn?….
for i,v in ipairs(vehicles) do
woz createVehicle(440v[1],v[2],v[3],v[4],v[5],v[6], v[7])
setElementData(woz"dostawczak"true)
end

--Miejsca roz?‚adunku skrzy?„.
local markery = { 
    {-302.51,1508.92,75.35},
    {-490.30,-556.37,25.52},
    {2228.13,-2222.40,13.54},
    {-170.75,-324.31,1.42},
    {2791.18,912.81,10.75},
    {-1567.79,395.08,7.18},
    {-2126.96,-88.05,35.32},
    {-1987.60,-1034.48,32.02},
    {-2465.56,2238.66,4.79},
    {-1967.44,-2436.49,30.62},
    {2597.02,-2426.39,13.49},
    {1574.33,1672.08,10.82},
    {2072.34,-2284.84,13.10},
    {-1240.57,-93.24,14.14},
    {848.88,-1208.38,16.97},
    {2370.08,2740.72,10.82},
    {1139.08,1946.88,10.82},
    {1041.67,2115.72,10.82},
    {1635.37,718.51,10.82},
    {2867.67,2613.79,10.87},
    {1454.70,2824.22,10.82},
    {-754.21,1587.95,26.96},
    {-1092.01,-1644.98,76.37},
    {660.14,1261.65,11.46 },
    {2276.60,-83.53,26.52 },
    {-26.23,-2508.93,36.66 }
}

function funkcja(he)
local v=getPedOccupiedVehicle(he)
local m=getElementModel(v)
if  not getElementData (he"ladunek"6then
if not getElementData (he"pracujesz"then
if m== 440 then
local vehicle getPedOccupiedVehicle(hesetVehicleFrozen vehicletrue )
outputChatBox("Trwa za?‚adunek pojazdu.",he,255,255,255)
setTimer(function()
setVehicleFrozen vehiclefalse )
local rnd math.random 1#markery )
cels createMarker(markery[rnd][1], markery[rnd][2], markery[rnd][3], "cylinder"1156,104,255)
blipCelu createBlipAttachedTo cels41setElementData(cels"dostawa"true)
setElementData(he"dostawczak"true)
setElementData(he"pracujesz"true)
setElementData(he"ladunek"6setElementData(cels"kogo:marker"getPlayerName(he))
outputChatBox("Dostarcz zamĂłwienie do wyznaczonego miejsca na mapie.",he,255,255,255)
end30001)
end
else
outputChatBox("Dostarcz najpierw poprzednie zamĂłwienie!",he,255,255,255)
end
end
end
addEventHandler("onMarkerHit"ladowaniefunkcja )



addEventHandler("onVehicleExit",root,function()
    if getElementModel(source) == 440 then
        if not isElement(polethen
        pole createMarker(0,0,0,"cylinder",2,255,255,2550)
        attachElements(polesource0, -2.3, -1.1)
            if not otwarte then
                setVehicleDoorOpenRatio(source415000)
                setVehicleDoorOpenRatio(source515000)
                    otwarte true
                    end
            end
    end
end)

addEventHandler("onVehicleEnter",root,function()
    if getElementModel(source) == 440 then
        if otwarte then
            setVehicleDoorOpenRatio(source405000)
            setVehicleDoorOpenRatio(source505000)
            otwarte false
        end
    end
end)


addEventHandler("onMarkerHit",root, function(he)
            if source == pole then
                if getElementType(he) == "player" then
                                if not getElementData(he"pracujesz"then
                outputChatBox("Nie pracujesz.",he,255,255,255)
                return end
                    local veh getPedOccupiedVehicle(he)
                        if veh then
                            if getElementModel(veh) == 440 then
                                if getElementData(veh"naladowany"then
                                        local number getElementData(he"ladunek") or 0
                                        if tonumber(number) >= 6 then
                                        outputChatBox("Pojazd jest juĹĽ za?‚adowany",he,255,255,255)
                                        return end
                                        
                                                            detachElements(skrzyn)
                                    destroyElement(skrzyn)
                                    setElementData(veh"naladowany"false)
                                        
                                        
                                        local ilosc getElementData(he"ladunek") or 0
                                                setElementData(he"ladunek"ilosc 1)
                                            end
                                        end
                                else
                                if getElementData(he"skrzynka"then
                                    outputChatBox("Masz juĹĽ na r?™kach skrzynk?™",he,255,255,255)
                                    return end
                                
                                                --setElementData(he"skrzynka"true)
                                                local number2 getElementData(he"ladunek")
                                                if tonumber(number2) <= 0 then
                                                    outputChatBox("Pojazd jest pusty",he,255,255,255)
                                                    return end
                                                    setElementFrozen(hetrue)
                                                setTimer(function()    
                                                    skrzyneczka createObject(12710,0,0)
                                attachElements(skrzyneczkahe00.80)
                                                setElementData(he"skrzynka"true)
                                            setPedAnimation(he"CARRY""crry_prtial"1true)

                                            local ilosc2 getElementData(he"ladunek") or 0
                                                setElementData(he"ladunek"ilosc2 1)
                                                                setElementFrozen(hefalse)
                            outputChatBox("Zanie?&#8250; skrzynke do odpowiedniego punktu",he,255,255,255)
                            
                            end1*10001)
                            outputChatBox("Odczekaj chwil?&#8482;, bierzesz skrzynk?&#8482;.",he,255,255,255)
                        setElementFrozen(hetrue)
                        setPedAnimation(he"CARRY""putdwn"1true)
                        setElementData(he"skrzynka"true)
            end            
        end
        
        
        
    elseif source == cels then
    if getElementType(he) == "player" then
                if not getElementData(he"pracujesz"then
                outputChatBox("Nie pracujesz.",he,255,255,255)
                return end
        if not getElementData(he"skrzynka"then
            if not isPedInVehicle(hethen
            outputChatBox("Nie masz skrzynki na r?&#8482;kach",he,255,255,255)
            end
        return end
            if getElementData(cels"kogo:marker") == getPlayerName(hethen
            setTimer(function(he)
            --if skrzyneczka then
                detachElements(skrzyneczka)
                destroyElement(skrzyneczka)

                setElementFrozen(hefalse)
                setPedAnimation(hefalse)
                setElementData(he"skrzynka"false)
                --triggerClientEvent(he"zaplac"he)
                setElementFrozen(hetrue)
                if getElementData(he"ladunek") <= 0 then
                                destroyElement(cels)
                        triggerClientEvent(plr"destroyBlip"he)
                outputChatBox("Masz 10 sekund aby wsi?&#8230;?&#8250;?&#8225; do pojazdu by zako?&#8222;czy?&#8225; zlecenie.",he,255,255,255)
                setTimer(function(he)
                local yh2 getPedOccupiedVehicle(he)
                    if yh2 then
                        if getElementModel(yh2) == 440 then
                            if getElementData(yh2"dostawczak"then
                                for i,v in pairs(vehicles) do
                                if v[7] == 1 then
                                    setElementPosition(yh22490.50854,-1680.10181,13.33654)
                                elseif v[7] == 2 then
                                    setElementPosition(yh22495.44263,-1681.39758,13.33895)
                                end
                            end
                
                --local price getElementData(he"money") or 0
                --givePlayerMoney(hetonumber(price))
                setElementData(he"money"nil)
                destroyElement(blipCelu)
                outputChatBox("Zako?&#8222;czy?&#8218;e?&#8250; zlecenie pomy?&#8250;lnie, otrzymujesz 500$.",255,255,255)
                givePlayerMoney(he500) -- Ilo?&#8250;?&#8225; pieni?&#8482;dzy dawanych za wykonanie zlecenia.
                setElementData(he"skrzynka"false)
                setElementData(he"ladunek"0)
                setElementData(he"pracujesz"false)
                    end
                end
            end
        end20*10001he)
                                setElementData(he"skrzynka"false)
                        setElementFrozen(hefalse)
                        setPedAnimation(hefalse)
                        end
                    end1*10001he)
                                        outputChatBox("Odczekaj chwil?&#8482;, odk?&#8218;adasz skrzynk?&#8482;.",he,255,255,255)
                    setElementFrozen(hetrue)
                    --setPedAnimation(he"CARRY""putdwn"1true)
                    setPedAnimation (he,"CARRY","putdwn",1000,false,false,nil,false) 
                    setTimer(function(he)
                    setElementFrozen(hefalse)
                    end1*10001he)
                    
                    end
            end
    end
end)




addEventHandler("onVehicleExit",root,function(plr)
    if getElementModel(he) == 440 then
        if getElementData(he"maj:laf:bi:lajk"then
        --        if getElementData(plr"ladunek"then
            if tonumber(getElementData(plr"ladunek")) >= 1 then
                setTimer(function(he)
                    destroyElement(he)
                    destroyElement(skrzyn)
                end10*10001he)
            return end
            
            setTimer(function(he)
            if not getVehicleController(hethen
            destroyElement(cels)
        --    destroyElement(blips)
            triggerClientEvent(he"destroyBlip"he)
            destroyElement(skrzyn)
            setElementData(he"naladowany"false)
            setElementData(he"maj:laf:bi:lajk"false)
            destroyElement(he)
            setElementData(he"pracujesz"false)
            outputChatBox("Przerwa?&#8218;e?&#8250;/a?&#8250; prac?&#8482;.",plr,255,255,255)
            end
        end30*10001he)
        outputChatBox("Masz 30 sekund aby powrĂłci?&#8225; do pojazdu.",he,255,255,255)
    end
end
end)

--Gdy co?&#8250; si?&#8482; zbuguje i chcesz zrestartowa?&#8225; skrypt to zamiast reconnectac wpisz /zeruj
addCommandHandler("zeruj",function(plr)
setElementData(plr"skrzynka"false)
setElementData(plr"ladunek"0)
setElementData(plr"pracujesz"false)
end)


Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-25, 21:25


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4556 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

Wstaw skrypt po clientSide

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-25, 21:54


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Najlepiej prace pisa? po stronie client, dlatego, ?e tworzenie marker?w, blip?w itp. b?d? tylko pokazywane dla jednego gracza.

Postaw piwo autorowi tego posta
 

 
Tagi: blipy :: marker
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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