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, 22:47


mixLoLmix2

Programista






Wiek: 35
Na forum: 4254 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Mam pasa?era i jak wjezdzam to nie dostaje Kasy



local jobMarker
local jobVehicle
local jobOdbieranie = createMarker(1922.41, 2314.70, 10.22, "cylinder", 6, 0, 0, 255)


local positionTrash = {
    {1641.78, 1821.85, 10.35},
    {1728.25, 1613.82, 9.36},
}

function finishJob()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
    if jobBlip and isElement(jobBlip) then
        destroyElement(jobBlip)
        jobBlip = nil
    end
end

function hideNextPoint(el, md)
    if el ~= localPlayer or not md then return end
    if not getPedOccupiedVehicle(el) then return end
    local pojazd = getPedOccupiedVehicle(el)
    if not getElementData(pojazd, "pojazd_smieci") then setElementData(pojazd, "pojazd_smieci", 0) end
     
    if getElementData(pojazd, "pojazd_smieci") > 1 then
        outputChatBox("* Posiadasz 1 Pasa?era! Jedz do Celu.")
        return
    end
    
    local smieci = getElementData(pojazd, "pojazd_smieci") + math.random(25, 35)
    
    finishJob()
    showNextPoint()
    playSoundFrontEnd(12)
    setElementData(pojazd, "pojazd_smieci", smieci)
    setElementData(pojazd, "vehicle:desc", "Pasa?er: 1")
end

function showNextPoint()
    jobRandom = math.random(1, #positionTrash)

    jobMarker = createMarker(positionTrash[jobRandom][1], positionTrash[jobRandom][2], positionTrash[jobRandom][3], "checkpoint", 4, 0, 0, 255)
    jobBlip = createBlipAttachedTo(jobMarker, 41)
    
    addEventHandler("onClientMarkerHit", jobMarker, hideNextPoint)
end

addEventHandler("onClientVehicleExit", resourceRoot, function(plr, seat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            outputChatBox("* Zako?czy?e? prac?")
            setElementData(source, "pojazd_smieci", 0)
            setElementData(plr, "gracz_praca", false)
        end
    end
end)

addEventHandler("onClientMarkerHit", jobOdbieranie, function(el, md)
    if not md or getElementType(el) ~= "player" then return end
    if el ~= localPlayer then return end
    if not getPedOccupiedVehicle(el) then return end
    local pojazd = getPedOccupiedVehicle(el)
    if getElementData(pojazd, "pojazd_smieci") and tonumber(1) <= getElementData(pojazd, "pojazd_smieci") then
        smieci = getElementData(pojazd, "pojazd_smieci") * 2.0
        
        setElementData(pojazd, "pojazd_smieci", 200)
        triggerServerEvent("givePlayerMoney", el, smieci, 1)
        setElementData(pojazd, "vehicle:desc", "Pasa?er: 0")
    else
    outputChatBox("* Nie posiadasz wi?cej ni?. 1 pasa?era")
    end
end)

addEvent("STARTJobTrash", true)
addEventHandler("STARTJobTrash", resourceRoot, function()
    showNextPoint()
end)



Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-31, 16:32


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

mixLoLmix2, Daj strone servera.

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

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

 
Wysłany: 2016-08-01, 15:19


mixLoLmix2

Programista






Wiek: 35
Na forum: 4254 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Juz dza?a

Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Tagi: nie :: dostaje :: kasy
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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