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

Wysłany: 2018-08-25, 22:43


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

Witam robi? prac? czyszczenia ulic i mam problem bo nie dzia?a mi naliczanie KG a ?adne b??dy nie wyskakuj? pomocy

local time=getTickCount()



function isEventHandlerAddedsEventNamepElementAttachedTofunc )
    if 
        typesEventName ) == 'string' and 
        isElementpElementAttachedTo ) and 
        typefunc ) == 'function' 
    then
        local aAttachedFunctions getEventHandlerssEventNamepElementAttachedTo )
        if typeaAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
            for iv in ipairsaAttachedFunctions ) do
                if == func then
                    return true
                end
            end
        end
    end
 
    return false
end
local function naliczaj2(veh)
    if getTickCount()-time>5000 then
        time getTickCount()
        local kg getElementData(veh,"kilogramy") or 0
        local vx,vy,vz getElementVelocity(veh)
        local spd=((vx^vy^vz^2)^(0.5)/2)
        if spd>0 then
            kg kg+(spd 1.25)
            setElementData(veh"kilogramy"kg)
        end
    end
end

function rendering2()
    local pojazd getPedOccupiedVehicle(localPlayer)
    if not pojazd then return end
    if getElementData(pojazd,"kilogramy") and getElementData(pojazd,"kilogramy"then
        naliczaj2(pojazd)
    end
end
addEventHandler("onClientVehicleEnter",root,function(p)
if ~= localPlayer then return end
if isTimer(timerthen killTimer(timerend
time=getTickCount()
timer setTimer(rendering2,5000,0)
end)
addEventHandler("onClientVehicleExit",root,function(p)
if ~= localPlayer then return end
if isTimer(timerthen killTimer(timerend
end)


a tu wy?wietlanie ale one powinno dzia?a? bo jak podpinam pod przebieg to normalnie wy?wietla


function zapelenienie()
    local pojazdy getElementsByType("vehicle",getRootElement())
    local rx,ry,rz getCameraMatrix()
    for i,pojazd in ipairs(pojazdy) do
        if getElementData(pojazd,"zbieranie"then
        local zapelenienie2 getElementData(pojazd"kilogramy") or 0
        local vx,vy,vz getElementPosition(pojazd)
        local x,y,getElementPosition(localPlayer)
        local distance getDistanceBetweenPoints3D(rx,ry,rz,vx,vy,vz)
        if distance <= 20 then
            local sx,sy getScreenFromWorldPosition(vx,vy,vz0.06)
            if sx and sy then
                if sx and sy then
                    dxDrawText("Zape?enienie: "..zapelenienie2.." KG"sx-7sy+30sx-1sy+25tocolor(255,255,255255), 1"default-bold","center","center",false,false,false,false,false)
                end
            end
        end
        end
    end
end
addEventHandler("onClientRender"rootzapelenienie)


Postaw piwo autorowi tego posta
 

 
Tagi: praca :: sweeper :: nie :: działa :: naliczanie
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