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
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
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
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?
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
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