Witam, przychodz? z takim pytankiem i? zabieram si? za robienie rzeczy 3d. Nie wiem czy tak to mog? nazwa?, ale chcia?bym zrobi? co? w stylu tego:
[img]https://i.imgur.com/KtVCXgK.png[/img]
Je?eli kto? by m?g? mnie nakierowa? co i jak to odwdzi?cz? si? piwkiem.
Spr?bowa?em co? takiego ale nic si? nie dzieje... ;/
[lua]
function getPositionFromElementOffset(element,offX,offY,offZ)
local m = getElementMatrix ( element ) -- Get the matrix
local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform
local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2]
local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3]
return x, y, z -- Return the transformed point
end
Tak jak w temacie
Zrobi?em gui oparte o cegui aczkolwiek chcia?bym teraz zmieni? to pod normalne gui, wiem jak aczkolwiek nie do ko?ca.
[lua]addEventHandler("onClientResourceStart", resourceRoot,
function()
rh = guiCreateWindow(282, 559, 220, 184, "Zawieszenie pneumatyczne", false)
guiWindowSetSizable(rh, false)
guiWindowSetMovable(rh, true)
gora = guiCreateButton(9, 23, 200, 61, "Podwy?sz", false, rh)
dol = guiCreateButton(9, 103, 200, 61, "Obni?", false, rh)
guiSetVisible(rh, false)
end
)
addEventHandler("onClientGUIClick", resourceRoot, function(btn)
local veh = getPedOccupiedVehicle(localPlayer)
if source == gora then
triggerServerEvent("rh:p", root, veh)
elseif source == dol then
triggerServerEvent("rh:o", root, veh)
end
end)
function patch()
local veh = getPedOccupiedVehicle(localPlayer)
if not veh then
if rh and ( guiGetVisible ( rh ) == true ) then
guiSetVisible(rh, false)
end
end
end
addEventHandler("onClientRender", root, patch)
function show()
guiSetVisible(rh, true)
end
addEvent( "rhshow", true )
addEventHandler( "rhshow", root, show )
fileDelete("c.lua")[/lua]
Witam mam taki problem, ?e gui pokazuje si? dla wszystkich. kod jest po stronie clienta kod:
[lua]teoriaAPokaz = false
teoriaBPokaz = false
teoriaCPokaz = false
local screenW, screenH = guiGetScreenSize()
local teoriaA = createMarker (2489.12, -1686.21, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
setElementInterior(teoriaA, 1)
local textA = createElement("text")
setElementData(textA, "name", "Cz??? teoretyczna prawa jazdy kat.A")
setElementPosition(textA, 2489.12, -1686.21, 51.95)
setElementInterior(textA, 1)
local teoriaB = createMarker (2471.55, -1676.93, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
setElementInterior(teoriaB, 1)
local textB = createElement("text")
setElementData(textB, "name", "Cz??? teoretyczna prawa jazdy kat.B")
setElementPosition(textB, 2471.55, -1676.93, 51.95)
setElementInterior(textB, 1)
local teoriaC = createMarker (2499.44, -1672.87, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
setElementInterior(teoriaC, 1)
local textC = createElement("text")
setElementData(textC, "name", "Cz??? teoretyczna prawa jazdy kat.C")
setElementPosition(textC, 2499.44, -1672.87, 51.95)
setElementInterior(textC, 1)
addEventHandler("onClientMarkerLeave", teoriaA, function(plr)
if teoriaAPokaz == true then
teoriaAPokaz = false
removeEventHandler("onClientRender", root, teoriaAGui)
end
end)
Witajcie u?ytkownicy forum gtao.pl chcia?bym spyta? jak po??czy? prac? z gui czyli wchodzimy w marker pokazuje si? gui z napisem rozpocznij po czym naciska si? rozpocznij i gracz wykonuje prace
witam pr?buj? odbugowa? paczke stories rpg i mam taki problem i? gdy? nie pojawia mi sie gui jak chce wystawic auto na gielde gdy auto jest zniszczone i wjade w market to jest napisane ze auto jest uszkodzone a jesli auto nie jest uszkodzone i wszystko jest okej gdy wje?d?am w marker nic sie nie pokazuje 0 reakcji tu macie kod
[quote]
local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
local w,h=(screenW/1680), (screenH/1050)
local font=dxCreateFont("f.ttf", 11)
local font2=dxCreateFont("f.ttf", 12)
local font3=dxCreateFont("f.ttf", 14)
local img=dxCreateTexture("i/sale.png")
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 pokapoka=false
Witam,posiadam taki problem ?e chcia?bym aby po wej?ciu w marker pojawia?o si? gui
niestety pr?bowa?em na r??ne sposoby i mi jako? nie wychodzi.
[lua]local b=createElement("text")
setElementData(b,"name","PRACA: Kierowca Street-ViewnZAROBEK:nOD 75PLN-150PLNnOPIS: Identyfikowanie mapy")
setElementPosition(b,-1990.74, 957.88, 45.45)
local zone = createColSphere(-1986.58, 955.03, 45.54,3 )
createBlip(-1984.40, 953.92, 45.45, 46,2,0,0,0,0,0,275)
local m1 = createMarker(-1990.74, 957.88, 45.45-1, "cylinder", 1.5, 35, 142, 35)
vehs = {}
local code = "StreetView"
veh_obj = {}
function removePreviousVehicles(plr)
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
local sby = getElementData(v, "zrespilGracz")
if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
destroyElement(v)
end
end
end
addEventHandler("onClientRender", root,
function siema()
dxDrawRectangle(387, 70, 524, 405, tocolor(48, 34, 35, 255), false)
end
)
addEventHandler("onMarkerHit", m1, function(el, md)
if getElementData(el, "vehicle_job_owner2") then
outputChatBox("Wyst?pi? b??d #6969, zg?o? si? do CEO!", el)
return
end
if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
if getElementData(el,"player:...
Cze??, zwracam si? do was z kolejnym problemem
Mam skrypt na rolety w poje?dzie wszystko dzia?a lecz,
doda?em funkcj? kt?ra odtwarza d?wi?ki podczas otwarcia i zamkni?cia. D?wi?k przy otwarciu gui odtwarza si? ale przy zamykaniu ju? nie. Je?li kto? wie dlaczego nie dzia?a b?d? bardzo wdzi?czny je?li kto? naprawi. Kod jest poni?ej
Witam, przychodz? z pytaniem, gdy? pisz? sobie dashboard i wpad?em na pomys?, ?eby pobiera?o naszego peda i jego ID tzn."wkleja?o" do gui.
Kto? m?g?by mnie nakierowa? jak? funkcj? to zrobi? czy co??
witajcie mam problem bo zrobi?em gui dzia?ajace i doda?em butony no i one s? w innej pozycji ni? ca?e gui ca?y panel .. i chcia?bym aby kto? pom?g? mi to zrobi? poprawnie tutaj udost?pniam kod i ss
kod [lua] local marker = createMarker ( 1034.4647216797,-1338.8609619141,13.7265625-1 , "cylinder" , 0.8,255,255,0)
Siemka pisze do was z takim zapytaniem czy ktos by tutaj ogarnal by ktos to ?e jak wchodze w marker gui si? wyswietla wszystkim na serwerze, ale chcialbym zeby wyswietlal si? tylko mi.
addEventHandler("onClientResourceStart",resourceRoot,
function()
guiSetVisible(GUIEditor.window[1],false)
end
)
function spod()
for i,v in ipairs(Marker) do
ta(v,rodzaj);
x, y, z = getElementPosition(v)
dxDrawOctagon3D(x,y,z+0.1, 0.8, 2, tocolor(0,0,255,150) )
end
end
addEventHandler("onClientRender", getRootElement(), spod)
function ta(TheElement,Image,distance,height,width,R,G,B,alpha)
local x, y, z = getElementPosition(TheElement)
local x2, y2, z2 = getElementPosition(localPlayer)
local distance = distance or 20
local height = height or 1
local width = width or 1
local checkBuildings = checkBuildings or true
local checkVehicles = checkVehi...
siemka m?cze sie z tym ju? godzinke .. dopiero sie ucze LUA i chce zrobi? takie cos ze jezeli gracz wejdzie w marker pokazuje mu gui w kt?rym bedzie m?gl np kupi? co? powiedzmy hamburger - i aby po zakupie bra?o mu pieniadze i dodawa?o HP jedyne co uda?o mi sie osiagn?c to zrobienie gui z podpisami ...
1. stworzy? marker ( m?j nie dzia?a )
2. ustawic aby za kupno zabiera?o pieniadze
3. i dodawa?o hp ..
4, oraz zrobic tak aby gui pokazywa?o sie po wejsciu w marker a nie odrazu po odpaleniu skryptu
function Closegui(button, state)
if panel and button == "left" and state == "down" then
if cursorPosition(screenW * 0.5688, screenH * 0.6094, screenW * 0.6501, s...
Witam, mam dla was skrypt w kt?rym gracz sobie sam robi tunning jednocze?nie maj?c na to podgl?d !
Czego? takiego nie widzia?em na GTAO wi?c pomy?la?em ?e to si? przyda szczeg?lnie Pseudolska na kt?rym tunnerzy to rzadko?? ! xd
Ukryta wiadomość / Hidden message(aby ją zobaczyć musisz postawić użytkownikowi)
Wiadomość została ukryta, aby ją przeczytać należy się zalogować.
PS; Skrypt nie jest m?j tylko jakiego? Angielskiego speca ! Co w nim zrobi?em ? :
- Dostosowa?em go pod OGRPG/PYS ( Domy?lnie by? pod FreeRoam )
- Doda?em t?umaczenie
- Poprawi?em gui
- Odbugowa?em Tabelki
- Doda?em zapis cze?ci
- Zoptymalizowa?em dzia?anie skryptu
- Poprawi?em czasami buguj?ce si? markery
- Doda?em zawansowany system notyfikacji, kt?ry jest odrazu w skrypcie
- Umo?liwi?em dodawania nowych cze?ci typu mk lub gz
Witam!
Ot?? morduje si? z tym problemem ju? godzin? i nie wiem co jest grane. Po naci?ni?ciu przycisku 'Anuluj' zabiera mi paczk? zamiast wy??czy? GUI. Prosze o pomoc, o poprawienie kodu. Za pomoc stawiam
[lua]
local praca = createMarker(1407.70, 1143.37, 5102.70-1, "cylinder", 2.0, 255, 255, 255, 80)
local t=createElement("text")
setElementData(t,"name", "Praca Dorywcza: Pracownik Magazynu")
setElementPosition(t,1407.70, 1143.37, 5102.70)
setElementDimension(t, 0)
setElementInterior(t, 0)
Znowu mam problem z GUI, problem polega na tym, ?e je?eli w GUI nr.1 klikn? Wi?cej informacji w miejscu gdzie w GUI nr.2 jest guzik zamkni?cia to GUI si? zamyka.
Je?eli w GUI nr.1 klikn? Wi?cej informacji w miejscu gdzie nie ma guzika zamykaj?cego GUI nr.2 to normalnie otwiera si? GUI nr.2 i potem mog? go zamkn?? guzikiem.
function isCursorOnElement(x,y,w,h)
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
addEventHandler("onClientClick", root, function(btn,state)
if btn=="left" and state=="down" then
if not pracaPanelGUI then return end
if Mysz(x, y, x, y) then
outputChatBox("Rozpocz??e? prac?")
ukryjGUI(localPlayer)
end
end
end)
addEventHandler("onClientClick", root, function(btn,state)
if btn=="left" and state=="down" then
if Mysz(x, y, x, y) then
showCursor(false)
removeEventHandler("onClientRender",root,pracaGUI)
end
end
end)
function pokazGUI(plr)
if plr ~= localPlayer then return end
addEventHandler("onClientRender",root,pracaGUI)
showCursor(true,true)
pracaPanelGUI = true
end
addEvent("pracaPanelGUI:pokaz",true)
addEventHandler("pracaPanelGUI:pokaz",root,p...
witam, chcia? bym do prac na serwerze doda? gui ?e jak wejdzie si? w marker to ?eby wy?wietla?o si? gui z rozpocz?ciem pracy oraz odbieraniem wyp?aty
za pomoc daje oraz Z G?RY DZI?KUJE
Witam,bo chcia?bym jak by kto? m?g? mi da? kod z gui co moge doda? sobie tam jaki chcem obraz i edytytowa? tekst.Wiem ?e nikt mi nie da gotowej na tacy,
Za pomoc daje respekt i
Witam, chcia?bym zrobi? do systemu "Top 10" tak, aby nie by?o to wy?wietlane jako lat?j?cy napis, tylko dxDrawText.
Kod:
str="(odswiezanie: 10 sekund)nRanking pracy kuriera:" local t=createElement("text") setElementData(t,"name",str) setElementPosition(t,2151.39, -2247.31, 14.89+1.5)
function aktualizujText() local q=exports["ogrpg-db"]:dbGet("select * from job_kurier_topka order by ilosc desc limit 10") str="(odswiezanie: 10 sekund)nRanking pracy kuriera:" for i,v in ipairs(q) do iii=i
local nick=exports["ogrpg-db"]:dbGet("select login,login2 from ogrpg_users where id=?", v["uid"])
for i2,v2 in ipairs(nick) do
if i2 < 1 then return end if v2["login2"] == false then
str=""..str.."n"..iii..". "..v2["login"].." - "..v["ilosc"].." oddane paczki" else str=""..str.."n"..iii..". "..v2["login2"].." - "..v["ilosc"].." oddane paczki" end
end
end
setElementData(t, "name", str) end
setTimer(aktualizujText, 10000, 0)
Siema, jak ukry? to GUI.
Teraz mam kod, kt?ry po klikni?ciu w przycisk wy?wietla wiadomo?? "test" na chacie, a zamiast tego chc?, aby GUI si? ukry?o, jak mam to zrobi??
Za pomoc daj?
Kod:
[lua]local markerZarcie = createMarker(-2382.43164, -584.20868, 132.11719-1, "cylinder", 1, 32,102, 23)
local sx,sy = guiGetScreenSize()
local px,py = (sx/1366),(sy/768)
function isMouseIn(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
Siema, mam problem ze zrobieniem gui aktualnej broni.
Chodzi o to, ?e pojawia mi si? pi???, ale po zmianie broni nic si? nie zmienia - dalej ona jest.
Z g?ry dzi?ki, za pomoc stawiam piwo.
Kod:
[lua]setPlayerHudComponentVisible("ammo", false)
setPlayerHudComponentVisible("armour", false)
setPlayerHudComponentVisible("clock", false)
setPlayerHudComponentVisible("health", false)
setPlayerHudComponentVisible("money", false)
setPlayerHudComponentVisible("vehicle_name", false)
setPlayerHudComponentVisible("weapon", false)
Witam!
Mam pytanie, ot?? jestem ciekawy jak mo?na zrobi? interaktywne gui, tzn. Rysuje nam obrazek, kt?ry musimy przenie?? w odpowiednie miejsce na ekranie.
Z g?ry dzi?ki.
Mia?em przerw? do?? d?ug? od edytowania i robienia na gui editorze.. I zapomnia?em wielu rzeczy. I dlatego nie wiem do ko?ca dlaczego jak dodam grafike hudu do gui z pysa to ta grafika wcale si? nie pokazuje, w mecie wszystko jest dopisane.. Ale nie wiem co jeszcze naprawi? w tym kodzie.. ;-;
[lua]local sx,sy=guiGetScreenSize()
local screenW, screenH=guiGetScreenSize()
function renderHUD()
if getElementData(localPlayer,"notshowhud") then return end
dxSetAspectRatioAdjustmentEnabled( true )
local realtime = getRealTime()
local hour = realtime.hour
local minute = realtime.minute
new path[200];
format(path, sizeof(path), "Konta/%s.ini", PlayerName(playerid));
if(!dini_Exists(path))
{
ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT, "Rejestracja", "{00FF00}Witaj %s na {FFFFFF}pA{0000FF}S {00FF00}! Musisz sie zarejestrwac.nn{00FF00}Podaj nowe haslo", "Gotowe", "Anuluj");
}
else
{
//If the player is registered
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Logowanie", "{00FF00}Te konto istnieje w naszej bazie danych!nnPodaj haslo do konta:", "Loguj", "Anuluj");
}
[/quote]
[quote]onplayerdisconnect:
Chodzi o to ?e robi? prawo jazdy i jestem pod czas tworzenia teori lecz po lecz jak klikn? Kat.a to przenosi do wyboru czy teoria czy praktyka i po klikni?ciu teoria przenosi do pytania nr 1 czyli tak jak ma by? lecz po klikni?ciu w pytaniu nr.1 na oboj?tnie kt?r? odpowiedz lub na X do zamykania okna nic si? nie dzieje prosz? o pomoc i? nie wiem co jest tego przyczyn? a i nie ma ni? w DB3
kawa?ek kodu strona client
[lua]
function onClientClick(button,state,cX,cY)
if not isCursorShowing() then
return
end
if button == "left" and state == "up" then
for k,self in pairs(editBox.instances) do
if self.visible then
if self.input then
self.input = nil
self.onOutput()
end
local x,y,w,h = self:getPosition()
if isMouseInPosition(x,y,w,h) then
self.input = true
self.onInput()
end
end
end
if rodzaj then
if isMouseInPosition(x*525,y*375,x*57,y*38) then -- Kategoria A
if not getElementData(localPlayer, "Prawko_A", true) or getElementData(localPlayer, "Prawko_B", true) or getElementData(localPlayer, "Prawko_C", true) or getElementData(localPlayer, "Prawko_D", true) then
rodzaj = false
etap = true
setElementData (localPlayer, "Prawko_A", true)
else
outputChatBox("NIE OSZUKUJ")
end
elseif isMouseInPosition(x*608,y*375,x*57,y*38) then -- Kategoria B
if not getElementD...