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

Wysłany: 2020-05-19, 23:26


HEATEX







Wiek: 25
Na forum: 2250 dni
Posty: 109
Nick w MP: HEATEX

Piwa: 1336

Respekt: 50

Ostrzeżeń: 20%
Witam mam prace busow lecz nie wiem czemu ale za jeden punkt nie dostaje sie rp
c.lua

sxsy guiGetScreenSize(  )

text createElement"text" )
setElementPositiontext1154.06, -1772.6716.60 )
setElementDatatext"name""Kierowca autobusu\nZarobki:\nWymagania\n 600RP Prawo Jazdy Kat C." )

praca createMarker1154.06, -1772.6715.6"cylinder")
createBlipAttachedTopraca4622552552552550250 )

addEventHandler"onClientRender"root, function()
    if isElementWithinMarkerlocalPlayerpraca then
        dxDrawImagesx 350 2sy 200 2350200"panel.png" )
        if isMouseInPositionsx 112 60sy 64 211264 then
            dxDrawImagesx 112 60sy 64 211264"miejska.png" )
        end
        if isMouseInPositionsx 112 60sy 64 211264 then
            dxDrawImagesx 112 60sy 64 211264"pozamiejska.png" )
        end
        showCursortruefalse )
    else
        showCursorfalsefalse )
    end
end )

addEventHandler"onClientClick"root, function( buttonstateabsoluteXabsoluteYworldXworldYworldZclickedElement )
    if button == "left" and state == "down" then
        if isElementWithinMarkerlocalPlayerpraca then
            if isMouseInPositionsx 112 60sy 64 211264 then
                if getElementDatalocalPlayer"player:srp" ) < 600 then
                    exports["pystories-notifications"]:createAlert"Nie posiadasz wymaganej reputacji. (0 RP)" )
                else
                    if getElementDatalocalPlayer"player:license:pjC" ) ~= and getElementDatalocalPlayer"player:license:pjC" ) ~= true then
                        exports["pystories-notifications"]:createAlert"Nie posiadasz prawajazdy kategorii C." )
                    else
                        triggerServerEvent "startujPrace"resourceRootlocalPlayer"miejska" )
                    end
                end
            end
            if isMouseInPositionsx 112 60sy 64 211264 then
                if getElementDatalocalPlayer"player:srp" ) < 600  then
                    exports["pystories-notifications"]:createAlert"Nie posiadasz wymaganej reputacji. (25 RP)" )
                else
                    triggerServerEvent "startujPrace"resourceRootlocalPlayer"pozamiejska" )
                end
            end
        end
    end
end )

setTimer( function()
    for k,v in pairsgetElementsByType"vehicle" ) ) do
        if getElementDatav"disabledCols" then
            newalpha 255
            lastAlpha 255
            for _,v2 in pairsgetElementsByType"vehicle" ) ) do
                if ~= v2 then
                    xygetElementPosition)
                    x2y2z2 getElementPositionv2 )
                    dist getDistanceBetweenPoints3Dxyzx2y2z2 )
                    alpha 255
                    if dist 4 then
                        alpha 100
                    elseif dist 3 then
                        alpha 40
                    elseif dist 2 then
                        alpha 10
                    end
                    if lastAlpha alpha then newalpha alpha end
                    setElementCollidableWithv2vfalse )
                    setElementCollidableWithvv2false )
                end
            end
            setElementAlphavnewalpha )
        end
    end
end1000)

addEvent"wylaczKolizje"true )
addEventHandler"wylaczKolizje"localPlayer, function( veh )
    for k,v in pairsgetElementsByType"vehicle" ) ) do
        setElementCollidableWithvehvfalse )
        setElementCollidableWithvvehfalse )
    end
end )

function zakonczPrace()
    destroyElementblip )
    destroyElementmarkerPracy )
    triggerServerEvent"koniecPracusi"resourceRootlocalPlayer )
    zadowolenie 100
end

addEvent"stopPracy"true )
addEventHandler"stopPracy"localPlayerzakonczPrace )

stacjeMiejskie = {
    {1171.75, -1776.2913.40359.929359.791270.153}, -- 431 Bus
    {1171.63, -1842.3113.41359.7870.035179.761}, -- 431 Bus
    {1107.45, -1848.3113.38359.795359.99290.625}, -- 431 Bus
    {967.59, -1777.5114.10359.72359.991270.364}, -- 431 Bus
    {921.53, -1708.6413.38359.785359.993270.046}, -- 431 Bus
    {919.98, -1604.2113.38359.826359.995359.427}, -- 431 Bus
    {945.44, -1576.1313.38359.8390.1269.616}, -- 431 Bus
    {1042.62, -1543.0113.36359.6970.07984.082}, -- 431 Bus
    {1064.12, -1441.3613.36359.794359.99489.668}, -- 431 Bus
    {1095.27, -1408.7913.47359.779359.99475.487}, -- 431 Bus
    {1217.72, -1408.5013.18359.557358.96990.556}, -- 431 Bus
    {1328.30, -1408.4413.33359.557358.96990.556},
    {1337.58, -1441.0313.38359.557358.96990.556},
    {1294.83, -1613.0113.38359.557358.96990.556},
    {1284.79, -1708.9213.38359.557358.96990.556},
    {1211.14, -1725.3613.57359.557358.96990.556},
}

stacjePozaMiejskie = {
    {966.98, -1778.8414.100.521358.93890.339}, -- 431 Bus
    {903.01, -1769.8014.10358.818358.76590.083}, -- 431 Bus
    {832.91, -1766.8213.400.027355.10190.094}, -- 431 Bus
    {769.54, -1763.3512.86359.984359.6189.362}, -- 431 Bus
    {758.78, -1741.5411.695.3580.1935.071}, -- 431 Bus
    {755.11, -1606.4413.12359.1490.771148.639}, -- 431 Bus
    {775.79, -1567.2813.38359.9030.00230.489}, -- 431 Bus
    {799.59, -1462.8513.38359.818359.992350.89}, -- 431 Bus
    {800.83, -1365.7613.38358.8250.011334.724}, -- 431 Bus
    {800.60, -1252.1413.51356.962359.988334.236}, -- 431 Bus
    {800.29, -1159.7123.74359.6370.05450}, -- 431 Bus
    {798.91, -1075.9024.23359.791359.99629.244}, -- 431 Bus
    {815.29, -1054.5124.92359.958359.959267.973}, -- 431 Bus
    {863.45, -1016.4730.341.603359.941269.974}, -- 431 Bus
    {907.96, -987.8937.630.1780.075269.783}, -- 431 Bus
    {976.90, -973.4539.381.8033.625358.809}, -- 431 Bus
    {961.48, -945.5940.31359.884359.99190.059}, -- 431 Bus
    {863.56, -889.3164.88359.791359.98290.274}, -- 431 Bus
    {829.25, -872.3568.79359.78359.996179.87}, -- 431 Bus
    {778.87, -904.8156.52359.9740.827181.154}, -- 431 Bus
    {735.45, -956.6154.27359.9340.245180.276}, -- 431 Bus
    {714.47, -984.7252.60359.62359.3180.132}, -- 431 Bus
    {699.89, -993.6952.60359.81359.996268.786}, -- 431 Bus
    {661.34, -924.3844.11359.142359.977180.044}, -- 431 Bus
    {624.07, -809.3721.56357.495359.995183.594}, -- 431 Bus
    {610.13, -721.8313.02357.325359.564178.75}, -- 431 Bus
    {624.55, -700.8412.23359.917359.989268.255}, -- 431 Bus
    {661.15, -699.4415.2900269.266}, -- 431 Bus
    {690.12, -838.8343.22000.775}, -- 431 Bus
    {721.52, -881.1743.32000.775},
    {790.19, -938.5541.97000.775},
    {792.74, -1028.9125.39000.775},
    {792.28, -1069.5024.47000.775},
    {794.59, -1168.6622.92000.775},
    {794.87, -1344.1213.38000.775},
    {793.04, -1444.4313.38000.775},
    {774.89, -1539.7713.38000.775},
    {747.46, -1598.0413.84000.775},
    {752.85, -1751.1412.70000.775},
    {755.01, -1783.8712.84000.775},
}

function nastepnyMarkerMiejskaidMarkeru )
    stacjeMiejskie[idMarkeru]
        if p then
        markerPracy createMarkerp[1], p[2], p[3], "cylinder")
        blip createBlipAttachedTomarkerPracy41 )
    else
        zakonczPrace()
    end
end

function nastepnyMarkerPozamiejskaidMarkeru )
    stacjePozaMiejskie[idMarkeru]
        if p then
        markerPracy createMarkerp[1], p[2], p[3], "cylinder")
        blip createBlipAttachedTomarkerPracy41 )
    else
        zakonczPrace()
    end
end

function sprawdzBiletliczba )
    if bilet == liczba then
        jeszczeJeden math.random1)
        if jeszczeJeden == 1 then
            exports["pystories-notifications"]:createAlert"Podajesz bilet." )
            bxbybx2by2 sx 235sy 85sx 235sy 10
            bilet math.random1)
        else
            exports["pystories-notifications"]:createAlert"Podajesz bilet." )
            removeEventHandler"onClientRender"rootbilety )
        end
        if typPracy == "miejska" then
            zadowoleniee zadowolenie 30
            if zadowoleniee 100 then zadowoleniee 100 end
            triggerServerEvent"givePlayerMoney"localPlayer50000 * (zadowoleniee 100) )
        else
            triggerServerEvent"givePlayerMoney"localPlayer50000 * (zadowoleniee 100) )
        end
    else
        exports["pystories-notifications"]:createAlert"Podano z?y bilet." )
        zadowolenie zadowolenie 10
        bxbybx2by2 sx 235sy 85sx 235sy 10
    end
end

function bilety(  )
    if pracuje then
        showCursortrue )

        dxDrawRectanglesx 250sy 100500200tocolor000155 ) )
        dxDrawRectanglesx 50sy 100200200tocolor000155 ) )

        dxDrawImagebxby16575"normalny.jpg" )
        dxDrawImagebx2by216575"ulgowy.jpg" )

        if bilet == 1 then
            dxDrawText"Klient prosi o Bilet normalny"0520sxsywhite1.5"default-bold""center" )
        else
            dxDrawText"Klient prosi o Bilet ulgowy"0520sxsywhite1.5"default-bold""center" )
        end

        if isMouseInPositionbxby16575 ) and getKeyState"mouse1" then
            cxcy getCursorPosition(  )
            cxcy cx sxcy sy
            bxby cx 165 2cy 75 2
            if bx sx 50 and bx sx 100 and by sy 100 and by sy 100 then
                sprawdzBilet)
            end
        elseif isMouseInPositionbx2by216575 ) and getKeyState"mouse1" then
            cxcy getCursorPosition(  )
            cxcy cx sxcy sy
            bx2by2 cx 165 2cy 75 2
            if bx2 sx 50 and bx2 sx 100 and by2 sy 100 and by2 sy 100 then
                sprawdzBilet)
            end
        end
    end
end

function biletF(  )
    addEventHandler"onClientRender"rootbilety )
    bilet math.random1)
    setElementVelocitygetPedOccupiedVehiclelocalPlayer ), 00)
    bxbybx2by2 sx 235sy 85sx 235sy 10
end

addEventHandler"onClientMarkerHit"root, function( plrdim )
    if plr == localPlayer then
        if source == markerPracy then
            aktualnyMarker aktualnyMarker 1
            destroyElementmarkerPracy )
            destroyElementblip )
            zadowolenie zadowolenie 30
            biletF()
            if typPracy == "miejska" then
                nastepnyMarkerMiejskaaktualnyMarker )
            else
                nastepnyMarkerPozamiejskaaktualnyMarker )
            end
        end
    end
end )

addEventHandler"onClientVehicleDamage"root, function(tteloss)
    if pracuje then
        zadowolenie zadowolenie loss 10
    end
end )

pracuje false
zadowolenie 100

addEvent"startPracy"true )
addEventHandler"startPracy"localPlayer, function( vehtyp )
    if typ == "miejska" then
        aktualnyMarker 1
        nastepnyMarkerMiejskaaktualnyMarker )
        pracuje true
        zadowolenie 100
    end
    if typ == "pozamiejska" then
        aktualnyMarker 1
        nastepnyMarkerPozamiejskaaktualnyMarker )
        pracuje true
        zadowolenie 100
    end
    typPracy typ
end )

addEventHandler"onClientRender"root, function()
    if pracuje then
        dxDrawRectanglesx 1251025050tocolor000155 ) )
        if zadowolenie 70 then
            ztt "Pasa?erowie s? zadowoleni!"
        elseif zadowolenie <= 70 and zadowolenie 40 then
            ztt "Pasa?erowie s? neutralni."
        else
            ztt "Pasa?erowie s? ?li!" 
        end
        if zadowolenie 0 then zadowolenie 0 end
        if zadowolenie 100 then zadowolenie 100 end
        dxDrawTextztt .. "\n" .. math.floor(zadowolenie) .. "%"sx 1635 16sx 1635 16white1"default-bold""center""center" )
    end
end )

setTimer( function()
    zadowolenie zadowolenie 1
end1000)

function isMouseInPosition xywidthheight )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    if ( cx >= and cx <= width ) and ( cy >= and cy <= height then
        return true
    else
        return false
    end
end

s.lua

veh = {}

miejscaSpawnu = {
    {1075.73, -1714.9213.45359.40.0269.6}, -- 431 Bus
}

function deleteColisionsWithVehiclesveh )
    setElementDataveh"disabledCols"true )
    for k,p in pairsgetElementsByType"player" ) ) do
        triggerClientEventp"wylaczKolizje"pveh )
    end
end

addEvent"koniecPracusi"true )
addEventHandler"koniecPracusi"resourceRoot, function( plr )
    if veh[plrthen
        destroyElementveh[plr] )
        veh[plr] = nil
    end
end )

addEvent"startujPrace"true )
addEventHandler"startujPrace"resourceRoot, function( plrtyp )
    if not veh[plrthen
        L math.random1#miejscaSpawnu )
        miejscaSpawnu[L]
        if typ == "miejska" then
            veh[plr] = createVehicle431m[1], m[2], m[3], m[4], m[5], m[6] )
        else
            veh[plr] = createVehicle437m[1], m[2], m[3], m[4], m[5], m[6] )
        end
        setVehicleColorveh[plr], 7911015594)
        setElementDataveh[plr], "plr"plr )
        setElementFrozenveh[plr], true )
        warpPedIntoVehicleplrveh[plr], )
        setVehicleHandlingveh[plr], "maxVelocity"50 )
        deleteColisionsWithVehiclesveh[plr] )
        triggerClientEventplr"startPracy"plrvehtyp )
    end
end )

addEventHandler"onPlayerVehicleExit"root, function( vehH )
    if getElementDatavehH"plr" ) == source then
        destroyElementvehH )
        veh[source] = nil
        triggerClientEventsource"stopPracy"source )
    end
end )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-20, 01:29


PatryKK.

Emeryt LUA






Wiek: 26
Na forum: 3061 dni
Posty: 1060
Nick w MP: PatryKK.

Piwa: 2322

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5

addEventHandler"onClientMarkerHit"root, function( plrdim )
    if plr == localPlayer then
        if source == markerPracy then
            aktualnyMarker aktualnyMarker 1
            destroyElementmarkerPracy )
            destroyElementblip )
            getElementData(source"player:srp"+1) 
            zadowolenie zadowolenie 30
            biletF()
            if typPracy == "miejska" then
                nastepnyMarkerMiejskaaktualnyMarker )
            else
                nastepnyMarkerPozamiejskaaktualnyMarker )
            end
        end
    end
end )


Postaw piwo autorowi tego posta
 

 
Tagi: busy :: nie :: daje
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Busy nie daje rp Odpowiedz do tematu

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