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

Wysłany: 2016-07-30, 20:22


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4290 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

Rookspack, ?adnych b??d?w? ... wchodzisz w dobry marker?. W kodzie wszystko jest ok :/

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:25


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

marcin778, W dobry marker. Ja ju? te x,y,z znam na pami?? XD. Z ciekawo?ci czy zadzia?a da?em rozmiar markeru i nic. Przetestuj u siebie byle gdzie. Zobacz czy u Ciebie b?dzie dzia?a? jak tak to podaj mi ten kod.

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:26


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Rookspack, zobacz ten kod:
resourceRoot = getResourceRootElement(getThisResource()) 

lok2 = {
{-1836.6999511719,111.59999847412,14.10000038147},
{948.70001220703,1720,7.9000000953674},
}

uzupe?nij = {
--Uzupe?nij marekry gdzie ma uzupe?nia?.
}

function markery ()
for k,v in ipairs(lok2) do
local marker = createMarker(v[1], v[2],v[3], "cylinder", 1.5, 255, 255, 0, 170)
setElementData(marker, "Praca:Smieciarki:Start", true)
end
end
addEventHandler("onResourceStart", resourceRoot, markery)

function uzupelnic ()
    for i, v in ipairs(uzupelnic) do
        local marker = createMarker(v[1], v[2],v[3], "cylinder", 1.5, 255, 255, 0, 170)
        setElementData(marker, "Praca:Smieciarki:Value", true)
    end
end
addEventHandler("onResourceStart", resourceRoot, markery)

local zaplata = 1 -- ilo?? wynagrodzenia za ka?dy kilogram ?mieci

function start_Praca (hitElement)
    if getElementData(source, "Praca:Smieciarki:Start")    then else return end
    if getElementType(hitElement) == "player" then  else return end
        local auto = getPedOccupiedVehicle(hitElement)
        if not auto then
    local pojazd = createVehicle(408, -1859.9000244141, 124.90000152588, 15.89999961853, 0)
    warpPedIntoVehicle(hitElement, pojazd)
    setElementData(pojazd, "zapelnienie", 0)
    setElementData(pojazd, "pojazd_opis", "Praca ?mierciarki")
    setElementData(pojazd, "pojazd_opis", "Zape?nienie 0%")
    elseif auto then
        local smieci = getElementData(auto, "zapelnienie")
            if smieci == 100 then
            givePlayerMoney(hitElement, 100*zaplata)
            outputChatBox("Roz?adowa?e? ?mieciarke. Dostajesz "..100*zaplata.."$", hitElement)
            end
        end
end
addEventHandler("onMarkerHit", getRootElement(), start_Praca)

function uzupelnic_Marker (hitElement)
    if getElementData(source, "Praca:Smieciarki:Start") then else return end
    if getElementType(hitElement) == "player" then  else return end
    local pojazd = getPedOccupiedVehicle(hitElement)
    if pojazd then else return end
    setElementData(pojazd, "zapelnienie", getElementData(pojazd, "zapelnienie") + 5 )
        setElementFrozen(pojazd, true)
        setTimer ( function()
            setElementFrozen(pojazd, false)
        end, 5000, 1 )
end
addEventHandler("onMarkerHit", getRootElement(), uzupelnic_Marker)


Uzupe?nij markery gdzie ma uzupe?nia? ?mieciark?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:27


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4290 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

lok2 = {
{-1836.6999511719,111.59999847412,14.10000038147},
{948.70001220703,1720,7.9000000953674},
}

function markery ()
for k,v in ipairs(lok2) do
local marker = createMarker(v[1], v[2],v[3], "cylinder", 1.5, 255, 255, 0, 170)
setElementData(marker, "Praca:Smieciarki:Start", true)
end
end
addEventHandler("onResourceStart", resourceRoot, markery)

local marker_Start = createMarker(x, y, z, "cylinder", 1.5, 255, 255, 0, 170)

function MarkerHit (hitElement)
    if getElementData(source, "Praca:Smieciarki:Start")    then else return end
    if getElementType(hitElement) == "player" then  else return end
    local pojazd = createVehicle(408, -1859.9000244141, 124.90000152588, 15.89999961853, 0)
    warpPedIntoVehicle(hitElement, pojazd)
    setElementData(pojazd, "zapelnienie", 0)
    setElementData(pojazd, "pojazd_opis", "Praca ?mierciarki")
local ile = getElementData(pojazd, "zapelnienie") or 0
    setElementData(pojazd, "pojazd_opis", "Zape?nienie: "..ile.."%",true)
end
addEventHandler("onMarkerHit", getRootElement(), MarkerHit)

local markerz = createMarker(x,y,z,"cylinder",1,255,255,255) -- marker dajacy 100 %


function sto(hitElement)
 if getElementData(source, "Praca:Smieciarki:Start")    then else return end
    if getElementType(hitElement) == "player" then  else return end
local pojazd2 = getPedOccupiedVehicle(hitElement)
if getElementData(pojazd2, "zapelnienie") <= 100 then
setElementData(pojazd2, "zapelnienie", 100)
outputChatBox("dodano",hitElement)
end
end
addEventHandler("onMarkerHit",markerz, sto)


[ Dodano: 2016-07-30, 20:29 ]
Kod luki123luki123, musi ci dzia?a?. :)

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:31


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Je?eli m?j kod nie podzia?a to sam go sprawdz?, a my?l? ?e ?adnego b??du nie ma.

[ Dodano: 2016-07-30, 20:32 ]
Chyba zaraz napisz? skrypt taki na gtao.pl od zera.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:33


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

luki123luki123, No w?a?nie DB3: '=' excepted near '


uzupe?nij = {
{-1840, 116, 14.10}
}

?? ?

[ Dodano: 2016-07-30, 20:34 ]
marcin778, Co do twojego kodu takie DB3:



Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:34


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Rookspack, czekaj daj 5 minut

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:36


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

Bo?e m?j my siedzimy nad tym 6h ;d.

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:39


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

dzia?a 100%
resourceRoot = getResourceRootElement(getThisResource()) 

lok2 = {
{-1836.6999511719,111.59999847412,14.10000038147},
{948.70001220703,1720,7.9000000953674}
}

uzupelnij = {
    {-1840, 116, 14.10}
}

function markery ()
for k,v in ipairs(lok2) do
local marker = createMarker(v[1], v[2],v[3], "cylinder", 1.5, 255, 255, 0, 170)
setElementData(marker, "Praca:Smieciarki:Start", true)
createBlipAttachedTo(marker, 5)
end
end
addEventHandler("onResourceStart", resourceRoot, markery)

function uzupelnic ()
    for i, v in ipairs(uzupelnij) do
        local marker = createMarker(v[1], v[2],v[3], "cylinder", 1.5, 255, 255, 0, 170)
        createBlipAttachedTo(marker, 3)
        setElementData(marker, "Praca:Smieciarki:Value", true)
    end
end
addEventHandler("onResourceStart", resourceRoot, uzupelnic)

local zaplata = 1 -- ilo?? wynagrodzenia za ka?dy kilogram ?mieci

function start_Praca (hitElement)
    if getElementData(source, "Praca:Smieciarki:Start")    then else return end
    if getElementType(hitElement) == "player" then  else return end
        local auto = getPedOccupiedVehicle(hitElement)
        if not auto then
    local pojazd = createVehicle(408, -1859.9000244141, 124.90000152588, 15.89999961853, 0)
    warpPedIntoVehicle(hitElement, pojazd)
    setElementData(pojazd, "zapelnienie", 0)
    setElementData(pojazd, "pojazd_opis", "Praca ?mierciarki")
    setElementData(pojazd, "pojazd_opis", "Zape?nienie 0%")
    elseif auto then
        local smieci = getElementData(auto, "zapelnienie")
            if smieci == 100 then
            givePlayerMoney(hitElement, 100*zaplata)
            outputChatBox("Roz?adowa?e? ?mieciarke. Dostajesz "..100*zaplata.."$", hitElement)
            end
        end
end
addEventHandler("onMarkerHit", getRootElement(), start_Praca)

function uzupelnic_Marker (hitElement)
    if getElementData(source, "Praca:Smieciarki:Start") then else return end
    if getElementType(hitElement) == "player" then  else return end
    local pojazd = getPedOccupiedVehicle(hitElement)
    if pojazd then else return end
    setElementData(pojazd, "zapelnienie", getElementData(pojazd, "zapelnienie") + 5 )
        setElementFrozen(pojazd, true)
        setTimer ( function()
            setElementFrozen(pojazd, false)
        end, 5000, 1 )
end
addEventHandler("onMarkerHit", getRootElement(), uzupelnic_Marker)


[ Dodano: 2016-07-30, 20:40 ]
PS: kto siedzi ten siedzi :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:42


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

luki123luki123, Mi nie daje zape?nienia.

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:45


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

daje sprawdzi?em w tym markerze w LV daje zape?nienie bo on jest do uzupe?nienia a tamte tylko do roz?adunku oraz do dawania pojazdu.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:48


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

luki123luki123, Dziwne, jestem w LV freeza mam i nie zape?nia mi si?.

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:51


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Rookspack, tylko napis ci si? nie zmienia czekaj.
resourceRoot = getResourceRootElement(getThisResource()) 

lok2 = {
{-1836.6999511719,111.59999847412,14.10000038147},
{948.70001220703,1720,7.9000000953674}
}

uzupelnij = {
    {-1840, 116, 14.10}
}

function markery ()
for k,v in ipairs(lok2) do
local marker = createMarker(v[1], v[2],v[3], "cylinder", 1.5, 255, 255, 0, 170)
setElementData(marker, "Praca:Smieciarki:Start", true)
createBlipAttachedTo(marker, 5)
end
end
addEventHandler("onResourceStart", resourceRoot, markery)

function uzupelnic ()
    for i, v in ipairs(uzupelnij) do
        local marker = createMarker(v[1], v[2],v[3], "cylinder", 1.5, 255, 255, 0, 170)
        createBlipAttachedTo(marker, 3)
        setElementData(marker, "Praca:Smieciarki:Value", true)
    end
end
addEventHandler("onResourceStart", resourceRoot, uzupelnic)

local zaplata = 1 -- ilo?? wynagrodzenia za ka?dy kilogram ?mieci

function start_Praca (hitElement)
    if getElementData(source, "Praca:Smieciarki:Start")    then else return end
    if getElementType(hitElement) == "player" then  else return end
        local auto = getPedOccupiedVehicle(hitElement)
        if not auto then
    local pojazd = createVehicle(408, -1859.9000244141, 124.90000152588, 15.89999961853, 0)
    warpPedIntoVehicle(hitElement, pojazd)
    setElementData(pojazd, "zapelnienie", 0)
    setElementData(pojazd, "pojazd_opis", "Praca ?mierciarki")
    setElementData(pojazd, "pojazd_opis", "Zape?nienie 0%")
    elseif auto then
        local smieci = getElementData(auto, "zapelnienie")
            if smieci == 100 then
            givePlayerMoney(hitElement, 100*zaplata)
            outputChatBox("Roz?adowa?e? ?mieciarke. Dostajesz "..100*zaplata.."$", hitElement)
            end
        end
end
addEventHandler("onMarkerHit", getRootElement(), start_Praca)

function uzupelnic_Marker (hitElement)
    if getElementData(source, "Praca:Smieciarki:Start") then else return end
    if getElementType(hitElement) == "player" then  else return end
    local pojazd = getPedOccupiedVehicle(hitElement)
    if pojazd then else return end
    setElementData(pojazd, "zapelnienie", getElementData(pojazd, "zapelnienie") + 5 )
        setElementFrozen(pojazd, true)
        setTimer ( function()
            setElementFrozen(pojazd, false)
        end, 5000, 1 )
        setElementData(pojazd, "pojazd_opis", "Praca ?mierciarki")
    setElementData(pojazd, "pojazd_opis", "Zape?nienie "..getElementData(pojazd, "zapelnienie").."%")
end
addEventHandler("onMarkerHit", getRootElement(), uzupelnic_Marker)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 20:54


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

luki123luki123, Tera dzia?a. Dzi?ki wielkie! 6h to robili?my XD. :piwo: :piwo: :piwo: :piwo:

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Tagi: jak :: zrobić :: zapełnienie :: np. :: śmieciarki?
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Jak zrobić zapełnienie np. śmieciarki? 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