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

Wysłany: 2020-06-22, 02:03


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam, pom?g?by kto? jak rozwi?za? taki b??d?
kod c_side

local mousePoints = {
{screenW * 0.4057, screenH * 0.3843, screenW * 0.0187, screenH * 0.0333},
{screenW * 0.4500, screenH * 0.4796, screenW * 0.0187, screenH * 0.0333},
{screenW * 0.4906, screenH * 0.5787, screenW * 0.0187, screenH * 0.0333},
{screenW * 0.4057, screenH * 0.3843, screenW * 0.0187, screenH * 0.0333},
}

target = 0


function kliki()
--    if getElementData(localPlayer, "praca") ~= "betoniarz" then return end
    if isMouseIn(mousePoints[target][1], mousePoints[target][2], mousePoints[target][3], mousePoints[target][4]) then
        target = target+1
        if target == #mousePoints then
local hajs = math.random(17, 30)
local hajsp = math.random(21, 38)
if getElementData(localPlayer, "player:premium") ~= true then 
triggerServerEvent("beton:hajs", localPlayer, hajs) 
triggerEvent("onClientAddNotification", el, "Odda?e?/a? paczk?\nOtrzymujesz "..hajs.." $", "info") 
else
triggerServerEvent("beton:hajs", localPlayer, hajsp) 
triggerEvent("onClientAddNotification", localPlayer, "Odda?e?/a? paczk?\nOtrzymujesz "..hajsp.." $ [PREMIUM]", "info") 
end
            target = 0
            setElementData(localPlayer, "beton:zakonczono", true)
            showCursor(false)
            stworzMarker()
            addEventHandler("onClientMarkerHit", mcel, onRandom)
        end
        return
    end
end
bindKey("mouse1", "down", kliki)

DB3:

attempt to index field '?' (a nil value)

B??d le?y tutaj

    if isMouseIn(mousePoints[target][1], mousePoints[target][2], mousePoints[target][3], mousePoints[target][4]) then


Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-22, 03:05


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

W pewnym momencie zmienna target zaczyna zwraca? liczb?, kt?ra przekracza ilo?? element?w. Dodaj limit na tej zmiennej.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-22, 15:06


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Wilq tak ?rednio rozumiem, jak taki limit ustali? ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-22, 18:06


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

if wartosc >= limit then wartosc = limit end


Postaw piwo autorowi tego posta
 

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


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Wilq warunek czaj? wiem jak go zastosowa? ale nie wiem co mam zast?pi? zmienn? warto?? ? Zast?pi?em na target, lecz dalej nie dzia?a zrobi?em tak.

function kliki()
--    if getElementData(localPlayer, "praca") ~= "betoniarz" then return end
local limit = 4
if target >= limit then target = limit end
    if isMouseIn(mousePoints[target][1], mousePoints[target][2], mousePoints[target][3], mousePoints[target][4]) then
        target = target+1
        if target == #mousePoints then
local hajs = math.random(17, 30)
local hajsp = math.random(21, 38)
if getElementData(localPlayer, "player:premium") ~= true then 
triggerServerEvent("beton:hajs", localPlayer, hajs) 
triggerEvent("onClientAddNotification", el, "Odda?e?/a? paczk?\nOtrzymujesz "..hajs.." $", "info") 
else
triggerServerEvent("beton:hajs", localPlayer, hajsp) 
triggerEvent("onClientAddNotification", localPlayer, "Odda?e?/a? paczk?\nOtrzymujesz "..hajsp.." $ [PREMIUM]", "info") 
end
            target = 0
            setElementData(localPlayer, "beton:zakonczono", true)
            showCursor(false)
            stworzMarker()
            addEventHandler("onClientMarkerHit", mcel, onRandom)
        end
        return
    end
end
bindKey("mouse1", "down", kliki)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-23, 09:20


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Warunek musi byc po tym, gdzie dodajesz te 2 liczby do siebie (target = target + 1).

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-23, 17:00


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Wilq, wstawi?em i dalej to samo :(

function kliki()
    if getElementData(localPlayer, "praca") ~= "kopalnia" then return end
    if isMouseIn(mousePoints[target][1], mousePoints[target][2], mousePoints[target][3], mousePoints[target][4]) then
        target = target+1
        if target >= 4 then target = 4 end    
        if target == #mousePoints then
            triggerServerEvent("hajskopalnia", localPlayer)
            target = 0
            setElementData(localPlayer, "kopalnia:zakonczono", true)
            showCursor(false)
            tworzenieMarkera()
            addEventHandler("onClientMarkerHit", markerRandomowy, onRandom)
        end
        return
    end
end
bindKey("mouse1", "down", kliki)


Postaw piwo autorowi tego posta
 

 
Tagi: index :: field
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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