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

Wysłany: 2016-03-06, 22:22


marcin778

Krytyk serwerów MTA






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

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Witam u?ywam
s- side
--[[
Praca rybaka

@copyright 2013-2014 Split <split@go-life.pl>
@author Split <split@go-life.pl>

Nie masz prawa u?ywac tego kodu bez mojej zgody.
Napisz do mnie bymo?e sizgodzna u?ycie kodu.
]]--

local m1 createMarker(-1974.14,160.63,27.69-0.8"cylinder"2.025500)
local blip createBlip(-1974.14,160.63,27.69-0.852)
vehs = {}


function removePreviousVehicles(plr)
    for i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
        local sby getElementData(v"zrespilGracz")
        if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
            destroyElement(v)
        end
    end
end

addEventHandler("onMarkerHit"m1, function(elmd)
    if getElementData(el"zrespilGracz"then
        outputChatBox("praca w trakcie poprawek"el)
        return
    end
    
    if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
    
    local x,y,getElementPosition(el)
    local bus createVehicle(537x,y,z1800.00.4)
    
    setElementData(bus"zrespilGracz"el)
    setElementData(bus"pojazd_paliwo"100)
    setElementData(bus"pojazd_przebieg"14564)
    
    warpPedIntoVehicle(elbus)
    removePreviousVehicles(el)
    triggerClientEvent(el"STARTJobBus"resourceRootbus)

    vehs[el] = bus
end)

addEvent("STOPJobBus"true)
addEventHandler("STOPJobBus"resourceRoot, function()
    local pojazd getPedOccupiedVehicle(localPlayer)
    if pojazd then
        destroyElement(pojazd)
    end
end)

addEvent("destroyVeh"true)
addEventHandler("destroyVeh"getRootElement(),
function()
     if vehs[sourcethen
          if isElement(vehs[source]) then destroyElement(vehs[source]) end
     end
end)


c-side
--[[
Praca busa

@copyright 2013-2014 Split <split@go-life.pl>
@author Split <split@go-life.pl>
@version 1.0 beta
@changelog:
* Poprawiono prac?.

Nie masz prawa u?ywac tego kodu bez mojej zgody.
Napisz do mnie bymo?e sizgodzna u?ycie kodu.
]]--

local districtsBus = {
    {-1944.00,-68.59,27.76},
    {-1951.20,-241.22,27.76},
    {-1979.62,-584.51,27.97},
    {-1176.12,-1517.47,42.79},
    {-801.06,-1185.03,68.30},
    {-386.50,-1244.08,43.85},
    {55.67,-1017.64,23.55},
    {808.23,-1360.02,0.56},
    {1741.79,-1953.31,15.63},
    {2198.16,-1865.81,15.88},
    {2284.35,-1380.21,26.17},
    {2155.51,-673.78,54.08},
    {2170.56,-357.12,54.32},
    {2765.57,-244.33,23.66},
    {2806.56,163.45,19.20},
    {2764.29,918.25,13.01},
    {2856.62,1527.66,12.88},
    {2780.54,1906.59,7.98},
    {2548.28,2521.18,12.88},
    {2385.43,2689.66,12.88},
    {2086.06,2693.66,13.10},
    {1583.99,2631.79,12.88},
    {1241.35,2631.79,12.88},
    {746.40,2489.46,22.63},
    {735.76,2241.82,20.02},
    {742.23,1881.28,8.00},
    {660.89,1320.52,13.88},
    {187.18,1249.83,24.88},
    {-299.47,1255.29,31.57},
    {-688.91,1164.05,31.69},
    {-946.82,986.62,36.63},
    {-1343.01,698.75,36.63},
    {-1684.21,450.90,16.28},
    {-1942.97,155.63,27.76},
}

local jobTarget
local jobMarker
local jobVehicle
local maxTarget #districtsBus

function finishJob()
    if jobMarker and isElement(jobMarkerthen
        destroyElement(jobMarker)
        jobMarker nil
    end
    
    if jobTarget and isElement(jobTargetthen
        destroyElement(jobTarget)
        jobTarget nil
        jobTarget 0
        
    end
    
triggerServerEvent("destroyVeh"localPlayer)

end


function busDriver(elmd)
    if el ~= localPlayer or not md then return end
    if jobTarget maxTarget and getPedOccupiedVehicle(elthen return end
    if jobTarget == maxTarget and not getPedOccupiedVehicle(elthen return end
    
    if jobTarget == #districtsBus then
        finishJob()
        playSoundFrontEnd(5)
        outputChatBox("* Zako?czy?e?/-a? prac?.")
    else
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("givePlayerMoney"localPlayer20)
    end
end

function showMarker()
    if jobMarker and isElement(jobMarkerthen
        destroyElement(jobMarker)
        jobMarker nil
    end
    
    jobTarget jobTarget 1
    jobMarker createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint"400255)
    
    if districtsBus[jobTarget+1then
        ile districtsBus[jobTarget+1]
        setMarkerTarget(jobMarkerile[1], ile[2], ile[3])
    end
    
    addEventHandler("onClientMarkerHit"jobMarkerbusDriver)
end

addEvent("STARTJobBus"true)
addEventHandler("STARTJobBus"resourceRoot, function(veh)
    outputChatBox("* Rozpocz??e?/-a? prac?.")
    jobVehicle veh
    jobTarget 0
    showMarker()
end)

addEventHandler("onClientResourceStop"resourceRoot, function()
    if jobVehicle and getElementData(localPlayer"gracz_praca"then
        setElementData(localPlayer"gracz_praca"false)
    end
end)


addEventHandler("onClientVehicleExit"resourceRoot, function(plrseat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            outputChatBox("* Zako?czy?e?/-a? prac?")
        end
    end
end)


Jest to praca maszynisty pociagu a problem jest taki, ze ani w tej ani zadnej innej nie daje pieniedzy za prace.

DB:
[2016-03-06 22:07] ERROR: Client (|PSP|Ml.Bryg|Marcin) triggered serverside event givePlayerMoney, but event is not added serverside

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

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

 
Wysłany: 2016-03-06, 23:11


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
marcin778, brak eventu na kas?, poszukaj dzia? lua pod tym k?tem bo temat by? wa?kowany ponad 10 razy

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-07, 12:39


marcin778

Krytyk serwerów MTA






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

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Temat do zamkni?cia :)

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

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

 
Tagi: prace :: wyplata
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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