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

Wysłany: 2023-04-02, 10:48


Mateuszkropkaaa







Wiek: 29
Na forum: 3008 dni
Posty: 9
Nick w MP: Mateuszkropkaaa

Piwa: 47

Respekt: 50

Witam nie dzia?a mi przepisywanie aut na moj? organizacj? nie wiem czemu w db3 nie ma nic:

s_org:

Kod:


--[[
Developed by Yolos . You dont have agree to use this code! ;3
]]
function refreshgui(element)
local uid=getElementData(element,"player:sid")
if not uid then return end
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE ownedPlayer=?", uid)
triggerClientEvent(element, "org:refresh", resourceRoot, result)
end

addEvent("org:check", true)
addEventHandler("org:check", resourceRoot, function(id,name)
-- Pobieramy SID gracza
local uid=getElementData(client,"player:sid")
if not uid then return end
-- Sprawdzamy czy jest jeszcze w?‚a?›cicielem
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND ownedPlayer=?", id, uid)
if #result < 0 then
outputChatBox("#ff0000✘ #ffffffNie jeste?› w?‚a?›cicielem pojazdu.", client, 255, 0, 0, true)
return
end
local org = getElementData(client,"player:organization")
if not org then outputChatBox("* Nie jeste?› w organizacji !",client,255,0,0) return end
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND parking=0", id, org)
if #result > 0 then
outputChatBox("#ff0000✘ #ffffffPojazd nie znajduje si?™ w przechowalni!.", client, 255, 0, 0, true)
return
end
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND ownedPlayer=?", id, uid)
if #result > 0 then
if result[1].ownedGroup ~= "0" then
local query=exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET ownedGroup=0 WHERE id=? AND ownedPlayer=?", id, uid)
outputChatBox("#00ff00??” #ffffffZmieni?‚e?›(a?›) pojazdowi "..name.." ("..id..") przypis na siebie.", client, 0, 0, 0, true)
refreshgui(client)
return
end
local query=exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET ownedGroup=? WHERE id=? AND ownedPlayer=?", org, id, uid)
if query then
outputChatBox("#00ff00??” #ffffffZmieni?‚e?›(a?›) pojazdowi "..name.." ("..id..") przypis na organizacje.", client, 0, 0, 0, true)
refreshgui(client)
end
end
end)

addEvent("org:download", true)
addEventHandler("org:download", resourceRoot, refreshgui)


c_org
Kod:

local marker=createMarker(-2636.36, -2.49, 6.13-1, "cylinder", 1.2, 255, 255, 255)
setElementDimension(marker, 0)
setElementInterior(marker, 0)
setElementData(marker,'marker:text','#00C645ORGANIZACJA')
setElementData(marker,'marker:downtext','Przepisywanie PojazdĂłw')
setElementData(marker,'marker:icon','carsell')

local marker1=createMarker(11384.35, 403.70, 19.85-1, "cylinder", 1.2, 255, 255, 255)
setElementDimension(marker1, 0)
setElementInterior(marker1, 0)
setElementData(marker1,'marker:text','#00C645ORGANIZACJA')
setElementData(marker1,'marker:downtext','Przepisywanie PojazdĂłw')
setElementData(marker1,'marker:icon','carsell')



function cursorPosition(x, y, w, h)
if (not isCursorShowing()) then
return false
end
local mx, my = getCursorPosition()
local fullx, fully = guiGetScreenSize()
cursorx, cursory = mx*fullx, my*fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end

local screenW, screenH = guiGetScreenSize()

gridlist = guiCreateGridList(0.28, 0.29, 0.44, 0.33, true)
guiGridListAddColumn(gridlist, "ID", 0.2)
guiGridListAddColumn(gridlist, "Nazwa", 0.2)
guiGridListAddColumn(gridlist, "Organizacja", 0.3)
guiSetVisible(gridlist, false)


function gui()
exports["buttons"]:createCustomWindow("Przepisywanie pojazdĂłw", screenW * 0.2726, screenH * 0.2733-25, screenW * 0.4548, screenH * 0.4543+25, tocolor(0, 198, 69), false)

exports["buttons"]:createCustomButton("Zamknij", screenW * 0.4268, screenH * 0.6390, screenW * 0.1369, screenH * 0.0638, 1)
exports["buttons"]:createCustomButton("Przepisz/Wypisz", screenW * 0.2839, screenH * 0.6390, screenW * 0.1369, screenH * 0.0638, 2)
end

addEventHandler("onClientClick", root, function(btn, state)
if getElementData(localPlayer, "marker:przepis") then
if btn == "left" and state == "down" then
if cursorPosition(screenW * 0.2839, screenH * 0.6390, screenW * 0.1369, screenH * 0.0638) then
local selectedRow=guiGridListGetSelectedItem(gridlist)
if selectedRow < 0 then return end
local id=tostring(guiGridListGetItemText(gridlist, selectedRow, 1))
local name=tostring(guiGridListGetItemText(gridlist, selectedRow, 2))
triggerServerEvent("org:check", resourceRoot, id, name)
elseif cursorPosition(screenW * 0.4268, screenH * 0.6390, screenW * 0.1369, screenH * 0.0638) then
removeEventHandler("onClientRender", root, gui)
setElementData(localPlayer, "marker:przepis", false)
showCursor(false)
guiSetVisible(gridlist, false)
end
end
end
end)

addEvent("org:refresh", true)
addEventHandler("org:refresh", resourceRoot, function(result)
guiGridListClear(gridlist)
for i,v in pairs(result) do
if string.len(v.plateText) < 1 then v.plateText="Brak" end
local row=guiGridListAddRow(gridlist)
if tostring(v.ownedGroup) == "0" then v.ownedGroup = "Brak" end
guiGridListSetItemText(gridlist, row, 1, v.id, false, false)
guiGridListSetItemText(gridlist, row, 2, exports["nrpg_vehicles"]:getVehicleName(v.model), false, false)
guiGridListSetItemText(gridlist, row, 3, v.ownedGroup , false, false)
end
end)

addEventHandler("onClientMarkerHit", marker, function(el,md)
if el~=localPlayer then return end
if not getElementData(el,"player:organization") then return end
if not guiGetVisible(gridlist) then
showCursor(true)
guiSetVisible(gridlist, true)
addEventHandler("onClientRender", root, gui)
setElementData(el, "marker:przepis", true)
triggerServerEvent("org:download", resourceRoot, el)
end
end)

addEventHandler("onClientMarkerHit", marker1, function(el,md)
if el~=localPlayer then return end
if not getElementData(el,"player:organization") then return end
if not guiGetVisible(gridlist) then
showCursor(true)
guiSetVisible(gridlist, true)
addEventHandler("onClientRender", root, gui)
setElementData(el, "marker:przepis", true)
triggerServerEvent("org:download", resourceRoot, el)
end
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2023-04-07, 08:21


xyzzzikk

.gg






Wiek: 18
Na forum: 2774 dni
Posty: 175
Nick w MP: aspyk

Piwa: 6499

Respekt: 30,5

karamba, pokazuje ci na chacie ze przepisales chociaz?

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2023-04-07, 09:17


Mateuszkropkaaa







Wiek: 29
Na forum: 3008 dni
Posty: 9
Nick w MP: Mateuszkropkaaa

Piwa: 47

Respekt: 50

Na czacie tak

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Tagi: przepisywanie :: samochodów :: organizacje
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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