function ustaw()
if source ~= button then return end
local veh = getPedOccupiedVehicle(localPlayer)
if not veh then outputChatBox("Nie jeste? w poje?dzie!") return end-- nie powinno si? zdarzy?
if getElementData(veh,"stereo:use") ~= true then
if dziecijp[getPlayerSerial(localPlayer)] then outputChatBox("Posiadasz zablokowan? mo?liwos? korzystania z STEREO.",255,255,255) return end
setElementData(veh,"stereo:link",DGS:dgsGetText(link))
setElementData(veh,"stereo:use", true)
DGS:dgsSetText(button,"WY??CZ RADIO")
else
if dziecijp[getPlayerSerial(localPlayer)] then outputChatBox("Posiadasz zablokowan? mo?liwos? korzystania z STEREO.",255,255,255) return end
setElementData(veh,"stereo:use", false)
DGS:dgsSetText(button,"W??CZ RADIO (PODAJ LINK DO MP3/PLS/M3U)")
end
end
addEventHandler ( "onDgsMouseClick", resourceRoot, ustaw )
[ Dodano: 2020-10-05, 22:21 ]
I jeszcze moo?esz sprawdzi? to co w pa?cie jest
https://pastebin.pl/view/67a19e30 - g?upie te zabezpieczenie anty hakerowskie, ju? drugi raz w przeci?gu tygodnia
Kocham cie twoj kod dziala
Ps. serio nie k?ami?c siedzia?em nad tym 5 h od 17:19 i myslalem co moge zrobic juz chcialem isc spac ale zobaczylem twoj post kocham cie no homo
local stereo = {}
dziecijp = {
["-"] = true,
["-"] = true,
}
DGS = exports.dgs
function x(plr)
if plr == localPlayer then
local veh = getPedOccupiedVehicle(localPlayer)
if getVehicleController(veh) ~= localPlayer then return end
okno = DGS:dgsCreateWindow(0.30, 0.86, 0.40, 0.10, "System STEREO (Kliknij F3 aby pokaza? kursor)", true)
DGS:dgsWindowSetMovable(okno, false)
DGS:dgsWindowSetSizable(okno, false)
button = DGS:dgsCreateButton(0.02, 0.47, 0.95, 0.16, "W??CZ RADIO (PODAJ LINK DO MP3/PLS/M3U)", true, okno)
link = DGS:dgsCreateEdit(0.02, 0.14, 0.95, 0.26, "", true, okno)
DGS:dgsSetVisible(okno, true)
end
end
function xd( button, state )
if button == "left" and state == "down" then
outputChatBox ("dziala")
end
end
addEventHandler ( "onDgsMouseClick", button, xd)
--[[function ustaw()
if source ~= button then return end
local veh = getPedOccupiedVehicle(localPlayer)
if not veh then outputChatBox("Nie jeste? w poje?dzie!") return end-- nie powinno si? zdarzy?
if getElementData(veh,"stereo:use") ~= true then
if dziecijp[getPlayerSerial(localPlayer)] then outputChatBox("Posiadasz zablokowan? mo?liwos? korzystania z STEREO.",255,255,255) return end
setElementData(veh,"stereo:link",DGS:dgsGetText(link))
setElementData(veh,"stereo:use", true)
DGS:dgsSetText(button,"WY??CZ RADIO")
else
if dziecijp[getPlayerSerial(localPlayer)] then outputChatBox("Posiadasz zablokowan? mo?liwos? korzystania z STEREO.",255,255,255) return end
setElementData(veh,"stereo:use", false)
DGS:dgsSetText(button,"W??CZ RADIO (PODAJ LINK DO MP3/PLS/M3U)")
end
end
addEventHandler ( "onDgsMouseClick", przycisk, ustaw )]]
function x2(plr)
if plr == localPlayer then
if okno and DGS:dgsGetVisible(okno,true) then
DGS:dgsSetVisible(okno, false)
end
end
end
addEventHandler("onClientPlayerVehicleEnter", getRootElement(),
function(theVehicle, seat)
if source ~= localPlayer then return end
if seat ~= 0 then return end
if getVehicleUpgradeOnSlot(theVehicle, 10) == 1086 then
if dziecijp[getPlayerSerial(localPlayer)] then outputChatBox("Posiadasz zablokowan? mo?liwos? korzystania z STEREO.",255,255,255) return end
x(source)
end
end)
function wyjebpanel()
local veh = getPedOccupiedVehicle(localPlayer)
if not veh then
if okno and ( DGS:dgsGetVisible(okno) == true ) then
DGS:dgsSetVisible(okno, false)
end
end
end
addEventHandler("onClientRender", root, wyjebpanel)
addEventHandler("onClientPlayerVehicleExit", getRootElement(),
function(theVehicle, seat)
if source ~= localPlayer then return end
if seat ~= 0 then return end
if getVehicleUpgradeOnSlot(theVehicle, 10) == 1086 then
x2(source)
end
end)
addEventHandler("onClientElementDataChange",root,function(data,_)
if getElementType(source) ~= "vehicle" then return end
if data ~= "stereo:use" then return end
local data_tog = getElementData(source,data)
if data_tog == true then
local url = getElementData(source,"stereo:link")
stereo[source]=playSound3D(url, 0, 0, 0, true)
setSoundVolume(stereo[source], 2)
setSoundEffectEnabled(stereo[source],"compressor",true)
setSoundMaxDistance(stereo[source], 50)
setElementDimension(stereo[source],getElementDimension(source))
setElementInterior(stereo[source],getElementInterior(source))
attachElements(stereo[source], source)
else
if not stereo[source] then return end
stopSound(stereo[source])
end
end)
addEventHandler("onClientElementStreamIn",root,function()
if getElementType(source) ~= "vehicle" then return end
if not stereo[source] then
local data_tog = getElementData(source,"stereo:use")
if data_tog == true then
local url = getElementData(source,"stereo:link")
stereo[source]=playSound3D(url, 0, 0, 0)
setSoundVolume(stereo[source], 0.6)
setSoundEffectEnabled(stereo[source],"compressor",true)
setSoundMaxDistance(stereo[source], 20)
setElementDimension(stereo[source],getElementDimension(source))
setElementInterior(stereo[source],getElementInterior(source))
attachElements(stereo[source], source)
end
end
end)
addEventHandler("onClientElementDestroy",root,function()
if getElementType(source) ~= "vehicle" then return end
local data_tog = getElementData(source,"stereo:use")
if data_tog == true then
if not stereo[source] then return end
stopSound(stereo[source])
end
end)
fileDelete("c.lua")
[ Dodano: 2020-10-05, 22:30 ]
Ale dzia?a wszystko
zapisze sobie twoj kod na zawsze i bede o tobie pamieta? MASZ ZIMNE PIWO I POWIEM KOLEDZE ZEBY TOBIE DAL
function xd( button, state )
if source == button then
if button == "left" and state == "down" then
outputChatBox ("dziala")
end
end
end
addEventHandler ( "onDgsMouseClick", resourceRoot, xd)
Pr?bujesz przypi?? handler do rzeczy, kt?rej jeszcze nie ma czyli buttona
?le, dopiero teraz zauwa?y?em - jak zdefuniujesz w funkcji xd button jako czytanie przycisku myszy to nie b?dziesz w stanie wczyta? button jako
przycisku w grze wi?c lepiej sobie zmie? nazwe?ictwo, najlepiej skr?tami tj. b - button, s - state itp.
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