Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local screenW, screenH = guiGetScreenSize()
- window = guiCreateWindow(0.26, 0.15, 0.48, 0.71, "Tablica zleceń", true)
- guiWindowSetSizable(window, false)
- guiSetAlpha(window, 0.89)
- text_memo = guiCreateMemo(0.02, 0.29, 0.97, 0.69, "", true, window)
- guiMemoSetReadOnly(text_memo, true)
- buttonPrzyjmijZlecenie = guiCreateButton(0.71, 0.06, 0.28, 0.08, "Przyjmij zlecenie", true, window)
- buttonZamknij = guiCreateButton(0.71, 0.17, 0.28, 0.08, "Zamknij", true, window)
- label1 = guiCreateLabel(0.03, 0.06, 0.31, 0.12, "Nagroda:", true, window)
- guiSetFont(label1, "default-bold-small")
- label2 = guiCreateLabel(0.03, 0.22, 0.25, 0.13, "Treść zlecenia:", true, window)
- guiSetVisible(window, false)
- local test = createColSphere(2778.02,-1626.28,11.46,1)
- function closeWindow()
- showCursor(false)
- guiSetVisible(window, false)
- removeEventHandler("onClientGUIClick", buttonZamknij, closeWindow)
- removeEventHandler("onClientGUIClick", buttonPrzyjmijZlecenie, acceptQuest)
- removeElementData(text_memo, "failedToImportQuest")
- end
- function acceptQuest()
- if getElementData(text_memo, "failedToImportQuest") then
- outputChatBox("Nie możesz przyjąć pustego zlecenia.", 255, 0, 0)
- triggerServerEvent("removeFailData", localPlayer, text_memo)
- closeWindow()
- return
- end
- outputChatBox("Przyjęto zlecenie.", 0, 255, 0)
- triggerServerEvent("applyQuest", localPlayer,localPlayer)
- end
- addEventHandler("onClientColShapeHit", test, function(el, md)
- if (not md) then return end
- if (el~=localPlayer) then return end
- addEventHandler("onClientGUIClick", buttonZamknij, closeWindow)
- addEventHandler("onClientGUIClick", buttonPrzyjmijZlecenie, acceptQuest)
- showCursor(true)
- guiSetVisible(window, true)
- local numer = 1
- triggerServerEvent("onPlayerRequestIBContents", localPlayer, numer)
- end)
- addEventHandler("onClientColShapeLeave", test, function(el, md)
- if (el~=localPlayer) then return end
- removeEventHandler("onClientGUIClick", buttonZamknij, closeWindow)
- removeEventHandler("onClientGUIClick", buttonPrzyjmijZlecenie, acceptQuest)
- showCursor(false)
- guiSetVisible(window, false)
- end)
- addEvent("onIBContentsRcvd", true)
- addEventHandler("onIBContentsRcvd", resourceRoot, function(dane)
- if (dane) then
- guiSetText(text_memo, dane.tresc)
- guiMemoSetReadOnly(text_memo, true)
- else
- guiSetText(text_memo, "Błąd z importem treści zlecenia. Skontaktuj się z administatorem ROOT.")
- guiMemoSetReadOnly(text_memo, true)
- setElementData(text_memo, "failedToImportQuest", true)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement