Skrypt: [lua]--[[
Resource: OURGame v2
Developers: Split <[email protected]>
You have no right to use this code without my permission.
(c) 2015 <[email protected]>. All rights reserved.
]]
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 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 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)
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
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