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

Wysłany: 2020-05-19, 17:26


killercycDDS

Migacz






Wiek: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

Respekt: 22

Witam bawi? si? w przerobienie jednego skryptu i chc? zrobi? ?e gdy dana typ towaru ma jak?? tam klas? nikt inny pr?cz danej firmy nie mo?e jej bra?



data.order = {
    {"?mieci","dupa", 10000000, 0},
    {"?mieci","test", 10000000, 0},
}
for i,v in ipairs(data.marker) do
    local marker = Marker(v[1], v[2], v[3]-.9, "cylinder", data.size, data.color[1], data.color[2], data.color[3], data.color[4])
    setBlipVisibleDistance(createBlipAttachedTo(marker, 51), 300)
    marker:setData("marker:loading", true)
end

data.window[1] = guiCreateWindow(460, 269, 446, 231, "Praca Transportera - ilo?? score: 0", false)
guiWindowSetSizable(data.window[1], false)

data.gridlist[1] = guiCreateGridList(9, 22, 427, 154, false, data.window[1])
guiGridListAddColumn(data.gridlist[1], "#", 0.1)
guiGridListAddColumn(data.gridlist[1], "Nazwa towaru", 0.2)
guiGridListAddColumn(data.gridlist[1], "Typ", 0.2)
guiGridListAddColumn(data.gridlist[1], "Wynagrodzenie", 0.2)
guiGridListAddColumn(data.gridlist[1], "Wymagany score", 0.2)

data.button[1] = guiCreateButton(62, 189, 155, 32, "Wybierz zaznaczony towar", false, data.window[1])
data.button[2] = guiCreateButton(227, 189, 155, 32, "Zamknij okno", false, data.window[1])
guiSetVisible(data.window[1], false) 

addEventHandler("onClientGUIClick", resourceRoot, function(button, state)
    if button == "left" and state == "up" then
        if source == data.button[1] then
            local selected = guiGridListGetSelectedItem(data.gridlist[1]) or -1
            if selected < 0 then return false, outputChatBox("Najpierw zaznacz towar!", 255, 0, 0, true) end
            
            local id = guiGridListGetItemText(data.gridlist[1], selected, 1)
            local name = guiGridListGetItemText(data.gridlist[1], selected, 2)
            local typ = guiGridListGetItemText(data.gridlist[1], selected, 3)
            local money = guiGridListGetItemText(data.gridlist[1], selected, 4)
            local score = guiGridListGetItemText(data.gridlist[1], selected, 5)
            local v = getPedOccupiedVehicle (localPlayer)
            randomResult = math.random(1, #data.marker)
            local x, y, z = data.marker[randomResult][1], data.marker[randomResult][2], data.marker[randomResult][3]
            local location = getZoneName ( x, y, z )
            local miasto = getZoneName (x, y, z, true)
            --then outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) return end 

            if typ == "dupa" and getElementData(localPlayer,"player:firma") == "P" then outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) end


lecz niestety jak zrobi? tak jak ni?ej to ka?dy mo?e bra? towar z danego typu kt?ry niby zablokowa?em

if typ == "dupa" and getElementData(localPlayer,"player:firma") == "P" then outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-19, 17:44


_jvneczek







Wiek: 22
Na forum: 4467 dni
Posty: 1509
Nick w MP: _jvneczek

Piwa: 3960

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5


data.order = {
    {"?mieci","dupa", 10000000, 0},
    {"?mieci","test", 10000000, 0},
}
for i,v in ipairs(data.marker) do
    local marker = Marker(v[1], v[2], v[3]-.9, "cylinder", data.size, data.color[1], data.color[2], data.color[3], data.color[4])
    setBlipVisibleDistance(createBlipAttachedTo(marker, 51), 300)
    marker:setData("marker:loading", true)
end

data.window[1] = guiCreateWindow(460, 269, 446, 231, "Praca Transportera - ilo?? score: 0", false)
guiWindowSetSizable(data.window[1], false)

data.gridlist[1] = guiCreateGridList(9, 22, 427, 154, false, data.window[1])
guiGridListAddColumn(data.gridlist[1], "#", 0.1)
guiGridListAddColumn(data.gridlist[1], "Nazwa towaru", 0.2)
guiGridListAddColumn(data.gridlist[1], "Typ", 0.2)
guiGridListAddColumn(data.gridlist[1], "Wynagrodzenie", 0.2)
guiGridListAddColumn(data.gridlist[1], "Wymagany score", 0.2)

data.button[1] = guiCreateButton(62, 189, 155, 32, "Wybierz zaznaczony towar", false, data.window[1])
data.button[2] = guiCreateButton(227, 189, 155, 32, "Zamknij okno", false, data.window[1])
guiSetVisible(data.window[1], false) 

addEventHandler("onClientGUIClick", resourceRoot, function(button, state)
    if button == "left" and state == "up" then
        if source == data.button[1] then
            local selected = guiGridListGetSelectedItem(data.gridlist[1]) or -1
            if selected < 0 then return false, outputChatBox("Najpierw zaznacz towar!", 255, 0, 0, true) end
            
            local id = guiGridListGetItemText(data.gridlist[1], selected, 1)
            local name = guiGridListGetItemText(data.gridlist[1], selected, 2)
            local typ = guiGridListGetItemText(data.gridlist[1], selected, 3)
            local money = guiGridListGetItemText(data.gridlist[1], selected, 4)
            local score = guiGridListGetItemText(data.gridlist[1], selected, 5)
            local v = getPedOccupiedVehicle (localPlayer)
            randomResult = math.random(1, #data.marker)
            local x, y, z = data.marker[randomResult][1], data.marker[randomResult][2], data.marker[randomResult][3]
            local location = getZoneName ( x, y, z )
            local miasto = getZoneName (x, y, z, true)
            --then outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) return end 

            if typ == "dupa" and getElementData(localPlayer,"player:firma") == "P" then outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) then return end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-19, 18:06


killercycDDS

Migacz






Wiek: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

Respekt: 22

"SataN." napisał/a:


data.order = {
    {"?mieci","dupa", 10000000, 0},
    {"?mieci","test", 10000000, 0},
}
for i,v in ipairs(data.marker) do
    local marker = Marker(v[1], v[2], v[3]-.9, "cylinder", data.size, data.color[1], data.color[2], data.color[3], data.color[4])
    setBlipVisibleDistance(createBlipAttachedTo(marker, 51), 300)
    marker:setData("marker:loading", true)
end

data.window[1] = guiCreateWindow(460, 269, 446, 231, "Praca Transportera - ilo?? score: 0", false)
guiWindowSetSizable(data.window[1], false)

data.gridlist[1] = guiCreateGridList(9, 22, 427, 154, false, data.window[1])
guiGridListAddColumn(data.gridlist[1], "#", 0.1)
guiGridListAddColumn(data.gridlist[1], "Nazwa towaru", 0.2)
guiGridListAddColumn(data.gridlist[1], "Typ", 0.2)
guiGridListAddColumn(data.gridlist[1], "Wynagrodzenie", 0.2)
guiGridListAddColumn(data.gridlist[1], "Wymagany score", 0.2)

data.button[1] = guiCreateButton(62, 189, 155, 32, "Wybierz zaznaczony towar", false, data.window[1])
data.button[2] = guiCreateButton(227, 189, 155, 32, "Zamknij okno", false, data.window[1])
guiSetVisible(data.window[1], false) 

addEventHandler("onClientGUIClick", resourceRoot, function(button, state)
    if button == "left" and state == "up" then
        if source == data.button[1] then
            local selected = guiGridListGetSelectedItem(data.gridlist[1]) or -1
            if selected < 0 then return false, outputChatBox("Najpierw zaznacz towar!", 255, 0, 0, true) end
            
            local id = guiGridListGetItemText(data.gridlist[1], selected, 1)
            local name = guiGridListGetItemText(data.gridlist[1], selected, 2)
            local typ = guiGridListGetItemText(data.gridlist[1], selected, 3)
            local money = guiGridListGetItemText(data.gridlist[1], selected, 4)
            local score = guiGridListGetItemText(data.gridlist[1], selected, 5)
            local v = getPedOccupiedVehicle (localPlayer)
            randomResult = math.random(1, #data.marker)
            local x, y, z = data.marker[randomResult][1], data.marker[randomResult][2], data.marker[randomResult][3]
            local location = getZoneName ( x, y, z )
            local miasto = getZoneName (x, y, z, true)
            --then outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) return end 

            if typ == "dupa" and getElementData(localPlayer,"player:firma") == "P" then outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) then return end


Wyt?umacz mi jedno czemu jak zrobi? tak to dzia?a

if typ == "dupa" then outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) return end

A jak ju? tak to ka?dy mo?e bra?

if typ == "dupa" and getElementData(localPlayer,"player:faction") then outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) return end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-19, 18:43


Maniekxx

Amator






Wiek: 24
Na forum: 3035 dni
Posty: 232
Nick w MP: Maniekxx

Piwa: 225

Respekt: 110
Respekt: 110

Ostrzeżeń: 20%
Spr?buj jeszcze tak, nie sprawdza?em wi?c nie wiem czy b?dzie dzia?a?:

if typ == "dupa" and getElementData(localPlayer,"player:faction") == "SAPD" then outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) return end


Albo wklej tu b??dy z /db3

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-19, 21:32


killercycDDS

Migacz






Wiek: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

Respekt: 22

"Maniekxx" napisał/a:

Spr?buj jeszcze tak, nie sprawdza?em wi?c nie wiem czy b?dzie dzia?a?:

if typ == "dupa" and getElementData(localPlayer,"player:faction") == "SAPD" then outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) return end


Albo wklej tu b??dy z /db3


i nie b?dzie dzia?a?. Gdyby by?y db3 to bym wcze?niej poda?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-19, 23:23


Qwertick

Coming soon...






Wiek: 23
Na forum: 3718 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2727

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

if typ == "dupa" then
     if getElementData(localPlayer, "player:faction") == "P" then  outputChatBox("Ten towar jest przeznaczony tylko i wy??cznie dla danej firmy", 255, 0, 0, true) return end
      ---Reszta... 
end


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
killercycDDS
Wysłany: 2020-05-20, 00:27


killercycDDS

Migacz






Wiek: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

Respekt: 22

do zamkni?cia

Postaw piwo autorowi tego posta
 

 
Tagi: zlecenia :: dla :: firm
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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