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: 21
Na forum: 3461 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:

--[[
    autor: Asper & Payro
    for: Own World
    All rights reserved!
]]

local screenW, screenH = guiGetScreenSize()
local sx, sy = 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", root, guiPrace)
    showCursor(true)
    showed = true
end)

addEvent("destroyJobsWindow", true)
addEventHandler("destroyJobsWindow", root, function()
    removeEventHandler("onClientRender", root, guiPrace)
    removeEventHandler("onClientRender", root, guiLevels)
    showCursor(false)
    showed = false
end)

local r,g,b = 50,50,50

local lvl_text = ""

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

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

addEventHandler("onClientClick", root, function(btn, state)
    if btn == "left" and state == "down" then
        if isMouseIn(screenW * 0.4130, screenH * 0.61, screenW * 0.1740, screenH * 0.0565) and showed then
            if getElementData(localPlayer, "user:job") and getElementData(localPlayer, "user:job") == details[2] then
                endJob()
            else
                acceptJob()
            end
        elseif isMouseIn(screenW * 0.4130, screenH * 0.67, screenW * 0.1740, screenH * 0.0565) and showed2 then
            removeEventHandler("onClientRender", root, guiLevels)
            showed2 = false
            showCursor(false)
        elseif isMouseIn(screenW * 0.4130, screenH * 0.67, screenW * 0.1740, screenH * 0.0565) and showed then
            removeEventHandler("onClientRender", root, guiPrace)
            showed = false
            showCursor(false)
        elseif isMouseIn(screenW * 0.4323, screenH * 0.4796, screenW * 0.1354, screenH * 0.0426) and showed2 then
            startJob(1)
        elseif isMouseIn(screenW * 0.4323, screenH * 0.5269, screenW * 0.1354, screenH * 0.0426) and showed2 then
            startJob(2)
        elseif isMouseIn(screenW * 0.4323, screenH * 0.5741, screenW * 0.1354, screenH * 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(localPlayer, details[13]) < details[7] then
            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(localPlayer, details[13]) < details[8] then
            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(localPlayer, details[13]) < details[9] then
            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", localPlayer, details[2], lvl)
    triggerServerEvent("onPlayerStartJob", localPlayer, details[2], lvl)
    removeEventHandler("onClientRender", root, guiLevels)
    showed2 = false
    showCursor(false)
end

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

function endJob()
    triggerServerEvent("playerResign", localPlayer, localPlayer, true)
end
addEvent("jobResign", true)
addEventHandler("jobResign", root, endJob)


Postaw piwo autorowi tego posta
 

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


Ciastuuś

As-salamu alaykum






Wiek: 27
Na forum: 3212 dni
Posty: 800
Nick w MP: Ciastuuś

Piwa: 4304

Respekt: 640
Respekt: 640Respekt: 640

Jakie? b??dy w debugscript 3?

Podpis
As-salamu alaykum
Postaw piwo autorowi tego posta
 

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


Husky123







Wiek: 21
Na forum: 3461 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: 3643 dni
Posty: 225
Nick w MP: psychol.

Piwa: 3003

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: 21
Na forum: 3461 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