Wysłany: 2020-08-02, 15:14
Kezoto Developer
Wiek: 20 Na forum: 276 dni Posty: 85
Nick w MP: Kezoto
Piwa : 44
Skrypt: --[[
Resource: OURGame v2
Developers: Split <split.programista@gmail.com>
You have no right to use this code without my permission.
(c) 2015 <split.programista@gmail.com>. All rights reserved.
]]
mojeW,mojeH = 1280, 1024
sW,sH = guiGetScreenSize()
w, h = (sW/mojeW), (sH/mojeH)
local sx, sy = guiGetScreenSize ()
prawko = false
function mysz(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 marker=createMarker(-2032.59, -117.51, 1035.17-1, "cylinder", 1.2, 255, 255, 0) -- Prawo Jazdy
setElementInterior(marker, 3)
setElementDimension(marker, 1)
--local marker2=createMarker(-2236.91, 2354.17, 4.98-1, "cylinder", 1.2, 0,128,0) -- Licencja Lotnicza
setElementInterior(marker2, 0)
local t=createElement("text")
setElementInterior(t, 3)
setElementDimension(t, 1)
setElementPosition(t,-2032.59, -117.51, 1035.17)
setElementData(t,"name","Zdawanie na prawo jazdy")
local t2=createElement("text")
setElementInterior(t2, 0)
setElementPosition(t2, -2237.23, 2353.97, 4.98)
--setElementData(t2,"name","Zdawanie licencji lotniczej")
local wm={}
wm.gridlist=guiCreateGridList(357*w, 393*h, 567*w, 218*h, false)
guiGridListAddColumn(wm.gridlist, "Kategoria", 0.24)
guiGridListAddColumn(wm.gridlist, "Pojazdy", 0.24)
guiGridListAddColumn(wm.gridlist, "Koszt", 0.24)
guiGridListAddColumn(wm.gridlist, "Zaliczone", 0.24)
guiSetVisible(wm.gridlist, false)
guiSetAlpha(wm.gridlist, 0.8)
guiSetFont(wm.gridlist, "default-bold-small")
local function fillLicenseData()
guiGridListClear(wm.gridlist)
for i,v in ipairs(licenseCategory) do
local row=guiGridListAddRow(wm.gridlist)
guiGridListSetItemText(wm.gridlist, row, 1, v[1], false, false)
guiGridListSetItemText(wm.gridlist, row, 2, v[2], false, false)
guiGridListSetItemText(wm.gridlist, row, 3, v[3].." PLN", false, false)
guiGridListSetItemData(wm.gridlist, row, 3, v[3])
-- Settings
if getElementData(localPlayer,"player:license:pj"..v[1]) == 1 then
guiGridListSetItemText(wm.gridlist, row, 4, "TAK", false, false)
guiGridListSetItemColor(wm.gridlist, row, 4, 0, 255, 0)
else
guiGridListSetItemText(wm.gridlist, row, 4, "NIE", false, false)
guiGridListSetItemColor(wm.gridlist, row, 4, 255, 0, 0)
end
end
end
local function fillLicenseData2()
guiGridListClear(wm.gridlist)
for i,v in ipairs(licenseCategory2) do
local row=guiGridListAddRow(wm.gridlist)
guiGridListSetItemText(wm.gridlist, row, 1, v[1], false, false)
guiGridListSetItemText(wm.gridlist, row, 2, v[2], false, false)
guiGridListSetItemText(wm.gridlist, row, 3, v[3].." PLN", false, false)
guiGridListSetItemData(wm.gridlist, row, 3, v[3])
-- Settings
if getElementData(localPlayer,"player:license:pj"..v[1]) == 1 then
guiGridListSetItemText(wm.gridlist, row, 4, "TAK", false, false)
guiGridListSetItemColor(wm.gridlist, row, 4, 0, 255, 0)
else
guiGridListSetItemText(wm.gridlist, row, 4, "NIE", false, false)
guiGridListSetItemColor(wm.gridlist, row, 4, 255, 0, 0)
end
end
end
addEventHandler("onClientClick", root, function(btn, state)
if btn == "left" and state == "down" then
if prawko == true then
if mysz(352*w, 624*h, 210*w, 78*h) then
local selectedRow=guiGridListGetSelectedItem(wm.gridlist)
if not selectedRow or selectedRow < 0 then return end
local cat=guiGridListGetItemText(wm.gridlist, selectedRow, 1)
local cost=guiGridListGetItemData(wm.gridlist, selectedRow, 3)
local zdane=guiGridListGetItemText(wm.gridlist, selectedRow, 4)
if tonumber(cost) > getPlayerMoney(localPlayer) then
triggerEvent('onClientAddNotification', localPlayer, 'Nie posiadasz wystarczajÄ…co gotĂłwki\ndo przystÄ…pienia egzaminu z prawa jazdy', 'error')
return
end
if zdane ~= "TAK" then
triggerServerEvent("license:do", resourceRoot, tonumber(cost), cat)
if not guiGetVisible(wm.gridlist) then return end
guiSetVisible(wm.gridlist, false)
showCursor(false)
prawko = false
removeEventHandler("onClientRender",root,gui3)
else
triggerEvent('onClientAddNotification', localPlayer, 'Posiadasz prawo jazdy zaznaczonej kategorii.', 'error')
end
end
end
end
end)
addEventHandler("onClientClick", root, function(btn, state)
if btn == "left" and state == "down" then
if prawko == true then
if mysz(718*w, 624*h, 210*w, 78*h) then
if not guiGetVisible(wm.gridlist) then return end
showCursor(false)
guiSetVisible(wm.gridlist, false)
removeEventHandler("onClientRender",root,gui3)
prawko = false
end
end
end
end)
addEventHandler("onClientMarkerHit", marker, function(el,md)
if not md or el~=localPlayer then return end
if guiGetVisible(wm.gridlist) then return end
showCursor(true)
guiSetVisible(wm.gridlist,true)
if prawko == false then
addEventHandler("onClientRender",root,gui3)
prawko = true
fillLicenseData()
end
end)
addEventHandler("onClientMarkerHit", marker2, function(el,md)
if not md or el~=localPlayer then return end
if guiGetVisible(wm.gridlist) then return end
showCursor(true)
guiSetVisible(wm.gridlist,true)
if prawko == false then
addEventHandler("onClientRender",root,gui3)
prawko = true
fillLicenseData2()
end
end)
function gui3()
dxDrawImage(315*w, 313*h, 650*w, 400*h, "img/prawojazdy-psrpg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end
debugscript 3:
WARNING: pystories-offices\license\c_license.lua:149: Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil]
Nie wiem o co chodzi
Wysłany: 2020-08-02, 15:18
PatryKK. Emeryt LUA
Wiek: 21 Na forum: 1143 dni Posty: 1061
Nick w MP: PatryKK.
Piwa : 1851
Wysłany: 2020-08-02, 15:32
Kezoto Developer
Wiek: 20 Na forum: 276 dni Posty: 85
Nick w MP: Kezoto
Piwa : 44
addEventHandler("onClientMarkerHit", marker2, function(el,md)
Wysłany: 2020-08-02, 15:47
killercycDDS Początkujący w LUA
Wiek: 20 Na forum: 2594 dni Posty: 570
Nick w MP: killer_cyc[DDS]
Piwa : 1204
Nie działa Ci dlatego bo masz tak
--local marker2=createMarker(-2236.91, 2354.17, 4.98-1, "cylinder", 1.2, 0,128,0) -- Licencja Lotnicza
Podmień na to
local marker2=createMarker(-2236.91, 2354.17, 4.98-1, "cylinder", 1.2, 0,128,0) -- Licencja Lotnicza
Wysłany: 2020-08-02, 15:50
Kezoto Developer
Wiek: 20 Na forum: 276 dni Posty: 85
Nick w MP: Kezoto
Piwa : 44
No tak, moje debilstwo level hard wrzucam zakomentowane i sie pytam czemu nie dziala XD pomylilo mi sie bo skryptuje w C# a tam sie komentuje " // " zamiast " -- " przepraszam za zabranie czasu , milego dnia, do zamkniecia
Tagi: [email protected] :: blokuje :: skrypt :: debugscript3
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: