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

Wysłany: 2018-03-15, 21:32


Rumper

Majster od pysa






Wiek: 15
Na forum: 3316 dni
Posty: 231
Nick w MP: Rumper

Piwa: 592

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 20%
Witam,bo mam taki problem z prac? ?e nie ma cel?w a i sie respi kilka aut zamiast jednego,jeszcze jak sie wysiada z auta to sie nie usuwa.
KOD:
S:
addEvent("createJobCar"true)
addEventHandler("createJobCar"root, function()
    job_car createVehicle(482, -2534.052734375, -614.11260986328132.54760742188)
end)

addEvent("deleteJobCar"true)
addEventHandler("deleteJobCar"root, function()
    destroyElement(job_car)
end)


addEventHandler("onVehicleDamage"root, function()
    if source == job_car then
        if getElementHealth(source) <= 350 then
            local thePlayer getVehicleController(source)
            triggerClientEvent (thePlayer"damageCarClient"thePlayer)
            destroyElement(job_car)
            setElementPosition(thePlayer, -2520.8732910156, -621.10137939453132.72)
        end
    end
end)

C:
--PRACA DORYWCZA BY ADIKOO1302--
--Autorem skryptu jest Adikoo1302--
--Pomagali mi nanKyNeQ.--
--Zakazujudost?pniania oraz zmiany autora--
--Zakazujedycji kodu do 5 linijki--

--SKALOWANIE GUI--
local screenWscreenH guiGetScreenSize()
local w= (screenW/1280), (screenH/1024)
--------------------------------------------
local job_marker createMarker(-2520.834960937, -623.51525878906131.75"cylinder"12526945)
--------------------------------------------
local guion false
job_activate false
--------------------------------------------
local target_possition = {
    {-2106.9226074219, -757.8468627929731.75},
    {-2286.3168945313, -13.99809646606434.75},
    {-2098.3623046875855.4948120117268.75}
}    

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

function job_gui()
    dxDrawImage(450*w300*h453*w420*h"images/background.png"000tocolor(255255255255), false)
    dxDrawImage(575*w630*h187*w58*h"images/button.png"000tocolor(255255255255), false)
    dxDrawImage(880*w305*h16*w16*h"images/exit.png"000tocolor(255255255255), false)
end

addEventHandler("onClientMarkerHit"job_marker, function()
    guion true
    addEventHandler("onClientRender"rootjob_gui)
    showCursor(true)
end)

addEventHandler("onClientClick"root, function(buttonstate)
    if state == 'down' then
        if guion == true then
            if isMouseInPosition(880*w305*h16*w16*hthen
                removeEventHandler("onClientRender"rootjob_gui)
                showCursor(false)
                guion false
            end
            if isMouseInPosition(575*w630*h187*w58*hthen
                if job_activate == false then    
                    removeEventHandler("onClientRender"rootjob_gui)
                    showCursor(false)
                    guion false
                    job_activate true
                    local Possition target_possition[math.random(#target_possition)]
                    job_blip createBlip(Possition[1], Possition[2], Possition[3], 56)
                    job_marker_target createMarker(Possition[1], Possition[2], Possition[3], "cylinder"12526945)
                    addEventHandler("onClientMarkerHit"job_marker_target, function()
                        local job_pay math.random(5002500)
                        outputChatBox("Gratulacje ! Zako?czy?e? prac? pomy?lnie !")
                        outputChatBox("Twoje wynagrodzenie to "..job_pay.."$ !")
                        setElementPosition(localPlayer, -2520.8732910156, -621.10137939453132.72)
                        givePlayerMoney(job_pay)
                        job_activate false
                        destroyElement(job_marker_target)
                        destroyElement(job_blip)
                        triggerServerEvent ("deleteJobCar"localPlayer)
                    end)
                    triggerServerEvent ("createJobCar"localPlayer)
                    outputChatBox("Pami?taj, ?e w punkt docelowy musisz wej?? postaci? !")
                else
                    outputChatBox("Ju? pracujesz !")
                end
            end
        end
    end
end)

addEvent("damageCarClient"true)
addEventHandler("damageCarClient"root, function()
    if job_activate == true then
        job_activate false
        outputChatBox("Tw?j pojazd odni?s? zbyt wielkie uszkodzenia.")
        outputChatBox("Praca zako?czona niepowodzeniem !")
        destroyElement(job_blip)
        destroyElement(job_marker_target)
    end
end)

I jak by m?g? kto? ten kod poprawi? na to co powy?ej napisa?em.
Za pomoc daje :piwo:

Postaw piwo autorowi tego posta
 

 
Tagi: zbagowana :: praca
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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