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

Wysłany: 2015-05-24, 13:25


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4245 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

Po stronie Servera
addEvent("obiektMagazynier"true)
addEventHandler("obiektMagazynier"root, function()
    local obiekt createObject(3800,0,0,1)
    setElementData(source"obiekt"obiekt)
    setElementData(source"wlasnosc"getPlayerName(source))
    exports.bone_attach:attachElementToBone(obiektsource1,00.5, -0.5000)
    setPedAnimation(source"CARRY""crry_prtial"1truetruefalse)
    setObjectScale(obiekt0.6)
end)

addEvent("delete_obiektMagazynier"true)
addEventHandler("delete_obiektMagazynier"root, function()
    if getElementData(source"wlasnosc") == getPlayerName(sourcethen
        if getElementData(source"obiekt"then
            local obiekt getElementData(source"obiekt")
            destroyElement(obiekt) 
            setPedAnimation(sourcefalse)
        end
    end
end)

addEventHandler("onPlayerQuit"root, function()
    if getElementData(source"wlasnosc") == getPlayerName(sourcethen
        if getElementData(source"obiekt"then
            local obiekt getElementData(source"obiekt")
            destroyElement(obiekt)
        end
    end
end)
addEvent("givePlayerMoney",true)addEventHandler("givePlayerMoney"root, function(ile)givePlayerMoney(sourcetonumber(ile))end)


Po stronie Clienta
local jobPoints = {
{-1267.962734.1750.10},
{-1258.072718.2850.10},
{-1268.222730.5450.10},
{-1260.362719.8950.10},
{-1262.462715.7450.10},
{-1273.582730.9150.10},
{-1268.062712.5250.10},
{-1279.142727.7250.10},
}

local x,y,z=-1282.312705.0749.10 -- pozycja gdzie ma stamarker

local jobMarker
local jobStartMarker=createMarker(x,y,z"cylinder"400255)
local jobStartBlip=createBlipAttachedTo(jobStartMarker52)

function finishJob()
    if jobMarker and isElement(jobMarkerthen
        destroyElement(jobMarker)
        jobMarker=nil
    end
    if jobTarget and isElement(jobTargetthen
        destroyElement(jobTarget)
        jobTarget=nil
    end
end

local function showMarker()
    rnd=math.random(1#jobPoints)
    jobMarker=createMarker(jobPoints[rnd][1], jobPoints[rnd][2], jobPoints[rnd][3], "checkpoint"100255)
    
    addEventHandler("onClientMarkerHit"jobMarker, function()
        if el~=localPlayer or not md then return end
        if not getPedOccupiedVehicle(elthen
            setElementFrozen(eltrue)
            outputChatBox("* K?adziesz karton na regale.")
            setTimer(function()
                finishJob()
                playSoundFrontEnd(1)
                setElementFrozen(elfalse)
                toggleControl("jump"true)
                toggleControl("sprint"true)
                toggleControl("enter_exit"true)
                setElementData(el"player_job"false)
                triggerServerEvent("givePlayerMoney"el30.4)
                triggerServerEvent("delete_obiektMagazynier"el)
            end50001)
        end
    end)
end

bindKey("e""down", function()
    if isElementWithinMarker(localPlayerjobStartMarkerthen
        if not getElementData(localPlayer"player_job"then
            --[[if getPlayerName(localPlayer) ~= "Terr" then
                outputChatBox("* Praca w trakcie poprawek.")
                return
            end]]
            outputChatBox("* Odnie? karton na wybrane miejsce."01280)
            triggerServerEvent("obiektMagazynier"localPlayer)
            setElementData(localPlayer"player_job"true)
            toggleControl("enter_exit"false)
            toggleControl("sprint"false)
            toggleControl("jump"false)
            showMarker()
        else
            outputChatBox("* Ju? posiadasz aktywn? prac?."25500)
        end
    end
end)


co zrobi? aby dostawa? pieni?dze oraz aby jak oddaje karton on znika? a nie zostawa? w r?kach prosz? o poprawienie kodu :(

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-24, 13:28


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-24, 13:32


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4245 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

addEvent("obiektMagazynier"true)
addEventHandler("obiektMagazynier"root, function()
    local obiekt createObject(3800,0,0,1)
    setElementData(source"obiekt"obiekt)
    setElementData(source"wlasnosc"getPlayerName(source))
    exports.bone_attach:attachElementToBone(obiektsource1,00.5, -0.5000)
    setPedAnimation(source"CARRY""crry_prtial"1truetruefalse)
    setObjectScale(obiekt0.6)
end)

addEvent("delete_obiektMagazynier"true)
addEventHandler("delete_obiektMagazynier"root, function()
    if getElementData(source"wlasnosc") == getPlayerName(sourcethen
        if getElementData(source"obiekt"then
            local obiekt getElementData(source"obiekt")
            destroyElement(obiekt) 
            setPedAnimation(sourcefalse)
        end
    end
end)

addEventHandler("onPlayerQuit"root, function()
    if getElementData(source"wlasnosc") == getPlayerName(sourcethen
        if getElementData(source"obiekt"then
            local obiekt getElementData(source"obiekt")
            destroyElement(obiekt)
        end
    end
end)
addEvent("givePlayerMoney",true)
addEventHandler("givePlayerMoney"root,function(ile)
givePlayerMoney(sourcetonumber(ile))
end)


Tak ??

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-24, 13:34


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

Tak i teraz powinno dziala?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-24, 13:36


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4245 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

addEvent("givePlayerMoney",true)
addEventHandler("givePlayerMoney"root,function(ile)
givePlayerMoney(sourcetonumber(ile))
end)


A gdzie tu pisze ile si? zarabia za 1 karton ??


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-24, 13:41


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

tu
 triggerServerEvent("givePlayerMoney"el30.4)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-24, 13:49


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4245 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

No i jak odnosze ten karton to nie dostaje pieni?dzy ani nie bierze mi kartona o co chodzi pomocy :(



Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: praca :: splita
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