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

Wysłany: 2018-02-06, 07:33


Husky123







Wiek: 20
Na forum: 3320 dni
Posty: 45
Nick w MP: fabeN

Piwa: 750

Respekt: 60

Jak naprawi? prace na gm OwnWorld ?
Kiedy w chodze w marker to pojawia mi Si? "Rozpocznij Prace" klikam i mam wybra? poziom po czym klikam na poziom i mi nie rozpoczynam pracy, jak to naprawi? ?

oto kod:

--[[
    autorAsper Payro
    for: Own World
    All rights reserved!
]]

local screenWscreenH guiGetScreenSize()
local sxsy guiGetScreenSize()

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

local showed false
local showed2 false

addEvent("onPlayerStartJob"true)
addEvent("onPlayerResign"true)
addEvent("onClientPlayerPayday"true)

local top = {} 

addEvent("createJobsWindow"true)
addEventHandler("createJobsWindow"root, function(det)
    details det
    addEventHandler("onClientRender"rootguiPrace)
    showCursor(true)
    showed true
end)

addEvent("destroyJobsWindow"true)
addEventHandler("destroyJobsWindow"root, function()
    removeEventHandler("onClientRender"rootguiPrace)
    removeEventHandler("onClientRender"rootguiLevels)
    showCursor(false)
    showed false
end)

local r,g,50,50,50

local lvl_text ""

function guiPrace()
        local b "Zatrudnij si?"
        if getElementData(localPlayer"user:job") == details[2then
            b "Zwolnij si?"
        end
        exports["buttons"]:createCustomWindow("Panel pracy"screenW 0.3599screenH 0.2417screenW 0.2802screenH 0.5176tocolor(255255255255), false)
       -- exports["buttons"]:createCustomText("Ranking pracy:\n"..table.concat(details[3], "\n"), screenW 0.3510screenH 0.2489screenW 0.6490screenH 0.5815tocolor(255255255255), 1.00font"center""center"falsetruefalsefalsefalse)
        exports["buttons"]:createCustomButton(bscreenW 0.4130screenH 0.61screenW 0.1740screenH 0.0565tocolor(255255255255), false)
        exports["buttons"]:createCustomButton("Anuluj"screenW 0.4130screenH 0.67screenW 0.1740screenH 0.0565tocolor(255255255255), false)
end

function guiLevels()
        exports["buttons"]:createCustomWindow("Wybierz poziom"screenW 0.3599screenH 0.2417screenW 0.2802screenH 0.5176tocolor(255255255255), false)
        --texty leveli
        if isMouseIn(screenW 0.4323screenH 0.4796screenW 0.1354screenH 0.0426then
            lvl_text details[4]
        elseif isMouseIn(screenW 0.4323screenH 0.5269screenW 0.1354screenH 0.0426then
            lvl_text details[5]
        elseif isMouseIn(screenW 0.4323screenH 0.5741screenW 0.1354screenH 0.0426then
            lvl_text details[6]
        end
        --
        exports["buttons"]:createCustomText("Opis poziomu:\n"..lvl_textscreenW 0.3510screenH 0.1989screenW 0.6490screenH 0.5815tocolor(255255255255), 1.00font"center""center"falsetruefalsefalsefalse)
        --3 levele
        exports["buttons"]:createCustomButton("Poziom 1"screenW 0.4323screenH 0.4796screenW 0.1354screenH 0.0426tocolor(255255255255), tocolor(r,g,b))
        exports["buttons"]:createCustomButton("Poziom 2"screenW 0.4323screenH 0.5269screenW 0.1354screenH 0.0426tocolor(255255255255), tocolor(r,g,b))
        exports["buttons"]:createCustomButton("Poziom 3"screenW 0.4323screenH 0.5741screenW 0.1354screenH 0.0426tocolor(255255255255), tocolor(r,g,b))
        --
        exports["buttons"]:createCustomButton("Anuluj"screenW 0.4130screenH 0.67screenW 0.1740screenH 0.0565tocolor(255255255255), false)
end

addEventHandler("onClientClick"root, function(btnstate)
    if btn == "left" and state == "down" then
        if isMouseIn(screenW 0.4130screenH 0.61screenW 0.1740screenH 0.0565) and showed then
            if getElementData(localPlayer"user:job") and getElementData(localPlayer"user:job") == details[2then
                endJob()
            else
                acceptJob()
            end
        elseif isMouseIn(screenW 0.4130screenH 0.67screenW 0.1740screenH 0.0565) and showed2 then
            removeEventHandler("onClientRender"rootguiLevels)
            showed2 false
            showCursor(false)
        elseif isMouseIn(screenW 0.4130screenH 0.67screenW 0.1740screenH 0.0565) and showed then
            removeEventHandler("onClientRender"rootguiPrace)
            showed false
            showCursor(false)
        elseif isMouseIn(screenW 0.4323screenH 0.4796screenW 0.1354screenH 0.0426) and showed2 then
            startJob(1)
        elseif isMouseIn(screenW 0.4323screenH 0.5269screenW 0.1354screenH 0.0426) and showed2 then
            startJob(2)
        elseif isMouseIn(screenW 0.4323screenH 0.5741screenW 0.1354screenH 0.0426) and showed2 then
            startJob(3)
        end
    end
end)

function startJob(lvl)
    if lvl == 1 then
        if details[10] ~= true then
            if getElementData(localPlayer"user:pj"..details[10]) and getElementData(localPlayer"user:pj"..details[10]) ~= 1 then
                exports["rpg_noti"]:createNotification("error""Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. "..details[10])
                return
            end
        end
        if getElementData(localPlayerdetails[13]) < details[7then
            exports["rpg_noti"]:createNotification("error""Aby pracowa? na tej pracy potrzebujesz "..details[7].." punkt?w")
            return
        end
    elseif lvl == 2 then
        if details[11] ~= true then
            if getElementData(localPlayer"user:pj"..details[11]) and getElementData(localPlayer"user:pj"..details[11]) ~= 1 then
                exports["rpg_noti"]:createNotification("error""Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. "..details[11])
                return
            end
        end
        if getElementData(localPlayerdetails[13]) < details[8then
            exports["rpg_noti"]:createNotification("error""Aby pracowa? na tej pracy potrzebujesz "..details[8].." punkt?w")
            return
        end
    elseif lvl == 3 then
        if details[12] ~= true then
            if getElementData(localPlayer"user:pj"..details[12]) and getElementData(localPlayer"user:pj"..details[12]) ~= 1 then
                exports["rpg_noti"]:createNotification("error""Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. "..details[12])
                return
            end
        end
        if getElementData(localPlayerdetails[13]) < details[9then
            exports["rpg_noti"]:createNotification("error""Aby pracowa? na tej pracy potrzebujesz "..details[9].." punkt?w")
            return
        end
    end
    setElementData(localPlayer"user:job"details[2])
    triggerEvent("onPlayerStartJob"localPlayerdetails[2], lvl)
    triggerServerEvent("onPlayerStartJob"localPlayerdetails[2], lvl)
    removeEventHandler("onClientRender"rootguiLevels)
    showed2 false
    showCursor(false)
end

function acceptJob()
    removeEventHandler("onClientRender"rootguiPrace)
    showCursor(false)
    showed false
    if not getElementData(localPlayer"user:job") or getElementData(localPlayer"user:job") == 0 then
        showCursor(true)
        showed2 true
        addEventHandler("onClientRender"rootguiLevels)
    else
        exports.rpg_noti:createNotification("error""Posiadasz ju? inn? prac?, aby si? z niej zwolnij wpisz /zrezygnuj")
    end
end
addEvent("acceptJob"true)
addEventHandler("acceptJob"rootacceptJob)

function endJob()
    triggerServerEvent("playerResign"localPlayerlocalPlayertrue)
end
addEvent("jobResign"true)
addEventHandler("jobResign"rootendJob)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-06, 12:23


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Jakie? b??dy w debugscript 3?

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-06, 23:26


Husky123







Wiek: 20
Na forum: 3320 dni
Posty: 45
Nick w MP: fabeN

Piwa: 750

Respekt: 60

"Ciastuu?" napisał/a:

Jakie? b??dy w debugscript 3?


Przepraszam za d?ug? odpowiedz ale sprawy prywatne oto debugscript 3



Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-07, 01:05


psychol.







Wiek: 23
Na forum: 3502 dni
Posty: 225
Nick w MP: psychol.

Piwa: 2998

Respekt: 244,5
Respekt: 244,5Respekt: 244,5

Fajnie ?e Payro podpisa? si? pod moj? prac?, pierwszy raz widz? ?e to zrobi?, jak wida? niewychowane to. Co do skryptu, z tego co mi si? wydaj? nie masz nadanej element-daty, wi?c jest na "false" i wyskakuje error, wydaje mi si? ?e w skrypcie z prac? jest wpisana z?a zmienna.

Podpis


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-07, 10:31


Husky123







Wiek: 20
Na forum: 3320 dni
Posty: 45
Nick w MP: fabeN

Piwa: 750

Respekt: 60

"Asper" napisał/a:

Fajnie ?e Payro podpisa? si? pod moj? prac?, pierwszy raz widz? ?e to zrobi?, jak wida? niewychowane to. Co do skryptu, z tego co mi si? wydaj? nie masz nadanej element-daty, wi?c jest na "false" i wyskakuje error, wydaje mi si? ?e w skrypcie z prac? jest wpisana z?a zmienna.


A Asper m?g? by? poda? jak powninen by? wpisany skrypt bym by? wdzi?czny !

Postaw piwo autorowi tego posta
 

 
Tagi: prace :: ownworld
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