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

Wysłany: 2018-07-01, 09:59


guciopl5







Wiek: 23
Na forum: 3287 dni
Posty: 86
Nick w MP: Whit3

Piwa: 8

Respekt: 45,3

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
 local marker = createMarker ( 1034.4647216797,-1338.8609619141,13.7265625-1 , "cylinder" , 0.8,255,255,0)


Panel = guiCreateWindow(600, 300, 336, 207, "Automat z napojami", false) 
guiWindowSetSizable(Panel, false) 

AddKamizelka = guiCreateButton(9, 31, 137, 67, "Cola + 5 HP ", false) 
AddUSPs = guiCreateButton(207, 36, 119, 62, "Lipton + 7 HP", false) 
AddM4A1S = guiCreateButton(9, 121, 137, 76, "Mountain Dew + 10 HP ", false) 
AddAK47 = guiCreateButton(203, 116, 123, 81, "Red Bull + 12 HP", false) 
guiSetVisible(Panel, false)
guiSetVisible(Panel, false)
guiSetVisible(AddKamizelka, false)
guiSetVisible(AddUSPs, false)
guiSetVisible(AddM4A1S,false)
guiSetVisible(AddAK47,false)

addEventHandler("onClientGUIClick",root,function ()
   if source == AddKamizelka  then 
     setElementHealth ( localPlayer, getElementHealth(localPlayer) + 5 ) 
     triggerServerEvent ("Cash", localPlayer, "take", 3)
outputChatBox (" Z maszyny wylatuje puszka napoju * Cola *")
outputChatBox (" Wypi?e? * Cola * zap?aci?e? 3$")
   elseif source == AddUSPs then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 7 ) 
     triggerServerEvent ("Cash", localPlayer, "take", 5)
outputChatBox (" Z maszyny wylatuje puszka napoju * Lipton *")
outputChatBox (" Wypi?e? * Lipton * zap?aci?e? 5$")
    elseif source ==  AddM4A1S  then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 10 ) 
     triggerServerEvent ("Cash", localPlayer, "take", 6)
outputChatBox (" Z maszyny wylatuje puszka  * Mountain Dew *")
outputChatBox (" Wypi?e? * Mountain Dew * zap?aci?e? 6$")
    elseif source ==  AddAK47  then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 12 ) 
     triggerServerEvent ("Cash", localPlayer, "take", 8)
outputChatBox (" Z maszyny wylatuje puszka z * Red Bull *")
outputChatBox (" Wypi?e? * Red Bull * zap?aci?e? 8$")

  end
end)

function Open_panel (el) 
if el~=localPlayer then return end
    guiSetVisible(Panel, true)
guiSetVisible(AddKamizelka, true)
guiSetVisible(AddUSPs, true)
guiSetVisible(AddM4A1S,true)
guiSetVisible(AddAK47,true)
showCursor(true,false)
end 
addEventHandler ("onClientMarkerHit", marker, Open_panel) 

function Close_panel(el) 
if el~=localPlayer then return end
    guiSetVisible(Panel, false)
guiSetVisible(AddKamizelka, false)
guiSetVisible(AddUSPs, false)
guiSetVisible(AddM4A1S,false)
guiSetVisible(AddAK47,false)
    showCursor (false,false) 
end 
addEventHandler ("onClientMarkerLeave",marker, Close_panel) 



i ss https://imgur.com/a/xLZXOsA

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-01, 11:33


santex







Wiek: 31
Na forum: 3128 dni
Posty: 21
Nick w MP: santex

Piwa: 186

Respekt: 50


 local sx,sy = guiGetScreenSize()

local baseX = 1920
local zoom = 1.0
local minZoom = 2 
if sx < baseX then 
    zoom = math.min(minZoom, baseX/sx)
end

local x,y,z =  1034.4647216797,-1338.8609619141,13.7265625
local marker = createMarker(x, y, z-1, "cylinder" , 0.8,255,255,0)
local panel_x, panel_y_, panel_w, panel_h = 746/zoom, 372/zoom, 429/zoom, 238/zoom
local addKamizelka_x, addKamizelka_y, addKamizelka_w, addKamizelka_h = 9/zoom, 31/zoom, 155/zoom, 63/zoom
local addUSPs_x, addUSPs_y, addUSPs_w, addUSPs_h = 261/zoom, 31/zoom, 155/zoom, 63/zoom
local addM4A1S_x, addM4A1S_y, addM4A1S_w, addM4A1S_h = 9/zoom, 150/zoom, 155/zoom, 63/zoom
local AddAK47_x, AddAK47_y, AddAK47_w, AddAK47_h = 261/zoom, 150/zoom, 155/zoom, 63/zoom

panel = guiCreateWindow(panel_x, panel_y_, panel_w, panel_h, "Automat z napojami", false)
addKamizelka = guiCreateButton(addKamizelka_x, addKamizelka_y, addKamizelka_w, addKamizelka_h, "Cola + 5 HP", false, panel)
addUSPs = guiCreateButton(addUSPs_x, addUSPs_y, addUSPs_w, addUSPs_h, "Lipton + 7 HP", false, panel)
addM4A1S = guiCreateButton(addM4A1S_x, addM4A1S_y, addM4A1S_w, addM4A1S_h, "Mountain Dew + 10 HP", false, panel)
addAK47 = guiCreateButton(AddAK47_x, AddAK47_y, AddAK47_w, AddAK47_h, "Red Bull + 12 HP", false, panel)  
guiSetVisible(panel, false)
guiSetVisible(addKamizelka, false)
guiSetVisible(addUSPs, false)
guiSetVisible(addM4A1S,false)
guiSetVisible(addAK47,false)

addEventHandler("onClientGUIClick",root,function ()
    if source == addKamizelka then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 5 ) 
    triggerServerEvent ("Cash", localPlayer, "take", 3)
    outputChatBox (" Z maszyny wylatuje puszka napoju * Cola *")
    outputChatBox (" Wypi?e? * Cola * zap?aci?e? 3$")
   elseif source == addUSPs then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 7 ) 
    triggerServerEvent ("Cash", localPlayer, "take", 5)
    outputChatBox (" Z maszyny wylatuje puszka napoju * Lipton *")
    outputChatBox (" Wypi?e? * Lipton * zap?aci?e? 5$")
    elseif source ==  addM4A1S  then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 10 ) 
    triggerServerEvent ("Cash", localPlayer, "take", 6)
    outputChatBox (" Z maszyny wylatuje puszka  * Mountain Dew *")
    outputChatBox (" Wypi?e? * Mountain Dew * zap?aci?e? 6$")
    elseif source ==  addAK47  then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 12 ) 
    triggerServerEvent ("Cash", localPlayer, "take", 8)
    outputChatBox (" Z maszyny wylatuje puszka z * Red Bull *")
    outputChatBox (" Wypi?e? * Red Bull * zap?aci?e? 8$")
    end
end)

function Open_panel (el) 
    if el~=localPlayer then return end
    guiSetVisible(panel, true)
    guiSetVisible(addKamizelka, true)
    guiSetVisible(addUSPs, true)
    guiSetVisible(addM4A1S,true)
    guiSetVisible(addAK47,true)
    showCursor(true,false)
end 
addEventHandler ("onClientMarkerHit", marker, Open_panel) 

function Close_panel(el) 
if el~=localPlayer then return end
    guiSetVisible(panel, false)
    guiSetVisible(addKamizelka, false)
    guiSetVisible(addUSPs, false)
    guiSetVisible(addM4A1S,false)
    guiSetVisible(addAK47,false)
    showCursor (false,false) 
end 
addEventHandler ("onClientMarkerLeave",marker, Close_panel) 


sprawdz.

Podpis

:-)

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
guciopl5
Wysłany: 2018-07-01, 12:00


guciopl5







Wiek: 23
Na forum: 3287 dni
Posty: 86
Nick w MP: Whit3

Piwa: 8

Respekt: 45,3

dzi?ki ,, dzia?? a jeszcze chcia? bym zrobic takie co? bo teraz jak gracz nie ma np 5$ to daje mu -5$ a chce aby pokazywa?o ?e nie masz pieniedzy jak zrobi? takie sprawdzenie ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-01, 12:04


santex







Wiek: 31
Na forum: 3128 dni
Posty: 21
Nick w MP: santex

Piwa: 186

Respekt: 50



local money = getPlayerMoney(localPlayer)
if money >= 5 then
-- informacja ze kupi?e?
else
outputChatBox("nie posiadasz funduszy")
end


Podpis

:-)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-01, 12:49


guciopl5







Wiek: 23
Na forum: 3287 dni
Posty: 86
Nick w MP: Whit3

Piwa: 8

Respekt: 45,3

nie dzia?a poka?esz gdzie mam to wkleic bo robie tak jak pokaza?e? i mam errory w DB3

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-01, 12:50


santex







Wiek: 31
Na forum: 3128 dni
Posty: 21
Nick w MP: santex

Piwa: 186

Respekt: 50

poka? kod i b??dy z DB3

Podpis

:-)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-01, 13:04


guciopl5







Wiek: 23
Na forum: 3287 dni
Posty: 86
Nick w MP: Whit3

Piwa: 8

Respekt: 45,3

 local sx,sy = guiGetScreenSize()

local baseX = 1920
local zoom = 1.0
local minZoom = 2 
if sx < baseX then 
    zoom = math.min(minZoom, baseX/sx)
end

local x,y,z =  1034.4647216797,-1338.8609619141,13.7265625
local marker = createMarker(x, y, z-1, "cylinder" , 0.8,255,255,0)
local panel_x, panel_y_, panel_w, panel_h = 746/zoom, 372/zoom, 429/zoom, 238/zoom
local addKamizelka_x, addKamizelka_y, addKamizelka_w, addKamizelka_h = 9/zoom, 31/zoom, 155/zoom, 63/zoom
local addUSPs_x, addUSPs_y, addUSPs_w, addUSPs_h = 261/zoom, 31/zoom, 155/zoom, 63/zoom
local addM4A1S_x, addM4A1S_y, addM4A1S_w, addM4A1S_h = 9/zoom, 150/zoom, 155/zoom, 63/zoom
local AddAK47_x, AddAK47_y, AddAK47_w, AddAK47_h = 261/zoom, 150/zoom, 155/zoom, 63/zoom

panel = guiCreateWindow(panel_x, panel_y_, panel_w, panel_h, "Automat z napojami", false)
addKamizelka = guiCreateButton(addKamizelka_x, addKamizelka_y, addKamizelka_w, addKamizelka_h, "Cola + 5 HP", false, panel)
addUSPs = guiCreateButton(addUSPs_x, addUSPs_y, addUSPs_w, addUSPs_h, "Lipton + 7 HP", false, panel)
addM4A1S = guiCreateButton(addM4A1S_x, addM4A1S_y, addM4A1S_w, addM4A1S_h, "Mountain Dew + 10 HP", false, panel)
addAK47 = guiCreateButton(AddAK47_x, AddAK47_y, AddAK47_w, AddAK47_h, "Red Bull + 12 HP", false, panel)  
guiSetVisible(panel, false)
guiSetVisible(addKamizelka, false)
guiSetVisible(addUSPs, false)
guiSetVisible(addM4A1S,false)
guiSetVisible(addAK47,false)

addEventHandler("onClientGUIClick",root,function ()
    if source == addKamizelka then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 5 ) 
    local money = takePlayerMoney(localPlayer)
    if money >= 3 then
    outputChatBox (" Z maszyny wylatuje puszka napoju * Cola *")
    outputChatBox (" Wypi?e? * Cola * zap?aci?e? 3$")
    else
    outputChatBox("nie posiadasz funduszy")
    end
   elseif source == addUSPs then  
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 7 )
    local money = takePlayerMoney(localPlayer)
    if money >= 5 then
    outputChatBox (" Z maszyny wylatuje puszka napoju * Lipton *")
    outputChatBox (" Wypi?e? * Lipton * zap?aci?e? 5$")
    else
    outputChatBox("nie posiadasz funduszy")
    end
    elseif source ==  addM4A1S  then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 10 ) 
    local money = takePlayerMoney(localPlayer)
    if money >= 6 then
    outputChatBox (" Z maszyny wylatuje puszka  * Mountain Dew *")
    outputChatBox (" Wypi?e? * Mountain Dew * zap?aci?e? 6$")
    else
    outputChatBox("nie posiadasz funduszy")
    end
    elseif source ==  addAK47  then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 12 ) 
    local money = takePlayerMoney(localPlayer)
    if money >= 8 then
    outputChatBox (" Z maszyny wylatuje puszka z * Red Bull *")
    outputChatBox (" Wypi?e? * Red Bull * zap?aci?e? 8$")
    else
    outputChatBox("nie posiadasz funduszy")
    end
    end
end)

function Open_panel (el) 
    if el~=localPlayer then return end
    guiSetVisible(panel, true)
    guiSetVisible(addKamizelka, true)
    guiSetVisible(addUSPs, true)
    guiSetVisible(addM4A1S,true)
    guiSetVisible(addAK47,true)
    showCursor(true,false)
end 
addEventHandler ("onClientMarkerHit", marker, Open_panel) 

function Close_panel(el) 
if el~=localPlayer then return end
    guiSetVisible(panel, false)
    guiSetVisible(addKamizelka, false)
    guiSetVisible(addUSPs, false)
    guiSetVisible(addM4A1S,false)
    guiSetVisible(addAK47,false)
    showCursor (false,false) 
end 
addEventHandler ("onClientMarkerLeave",marker, Close_panel) 



a wyskakuje to https://imgur.com/a/fakB4Az

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-01, 13:25


OchIAch







Wiek: 27
Na forum: 3255 dni
Posty: 144
Nick w MP: OchIAch

Piwa: 1312

Respekt: 105,3
Respekt: 105,3

Ostrzeżeń: 100%
 local sx,sy = guiGetScreenSize()

local baseX = 1920
local zoom = 1.0
local minZoom = 2 
if sx < baseX then 
    zoom = math.min(minZoom, baseX/sx)
end

local x,y,z =  1034.4647216797,-1338.8609619141,13.7265625
local marker = createMarker(x, y, z-1, "cylinder" , 0.8,255,255,0)
local panel_x, panel_y_, panel_w, panel_h = 746/zoom, 372/zoom, 429/zoom, 238/zoom
local addKamizelka_x, addKamizelka_y, addKamizelka_w, addKamizelka_h = 9/zoom, 31/zoom, 155/zoom, 63/zoom
local addUSPs_x, addUSPs_y, addUSPs_w, addUSPs_h = 261/zoom, 31/zoom, 155/zoom, 63/zoom
local addM4A1S_x, addM4A1S_y, addM4A1S_w, addM4A1S_h = 9/zoom, 150/zoom, 155/zoom, 63/zoom
local AddAK47_x, AddAK47_y, AddAK47_w, AddAK47_h = 261/zoom, 150/zoom, 155/zoom, 63/zoom

panel = guiCreateWindow(panel_x, panel_y_, panel_w, panel_h, "Automat z napojami", false)
addKamizelka = guiCreateButton(addKamizelka_x, addKamizelka_y, addKamizelka_w, addKamizelka_h, "Cola + 5 HP", false, panel)
addUSPs = guiCreateButton(addUSPs_x, addUSPs_y, addUSPs_w, addUSPs_h, "Lipton + 7 HP", false, panel)
addM4A1S = guiCreateButton(addM4A1S_x, addM4A1S_y, addM4A1S_w, addM4A1S_h, "Mountain Dew + 10 HP", false, panel)
addAK47 = guiCreateButton(AddAK47_x, AddAK47_y, AddAK47_w, AddAK47_h, "Red Bull + 12 HP", false, panel)  
guiSetVisible(panel, false)
guiSetVisible(addKamizelka, false)
guiSetVisible(addUSPs, false)
guiSetVisible(addM4A1S,false)
guiSetVisible(addAK47,false)

addEventHandler("onClientGUIClick",root,function ()
    if source == addKamizelka then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 5 ) 
    local money = getPlayerMoney(localPlayer)
    if money >= 3 then
    takePlayerMoney(3)
    outputChatBox (" Z maszyny wylatuje puszka napoju * Cola *")
    outputChatBox (" Wypi?e? * Cola * zap?aci?e? 3$")
    else
    outputChatBox("nie posiadasz funduszy")
    end
   elseif source == addUSPs then  
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 7 )
    local money = getPlayerMoney(localPlayer)
    if money >= 5 then
    takePlayerMoney(localPlayer, 5)
    outputChatBox (" Z maszyny wylatuje puszka napoju * Lipton *")
    outputChatBox (" Wypi?e? * Lipton * zap?aci?e? 5$")
    else
    outputChatBox("nie posiadasz funduszy")
    end
    elseif source ==  addM4A1S  then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 10 ) 
    local money = getPlayerMoney(localPlayer)
    if money >= 6 then
    takePlayerMoney(localPlayer, 6)
    outputChatBox (" Z maszyny wylatuje puszka  * Mountain Dew *")
    outputChatBox (" Wypi?e? * Mountain Dew * zap?aci?e? 6$")
    else
    outputChatBox("nie posiadasz funduszy")
    end
    elseif source ==  addAK47  then 
    setElementHealth ( localPlayer, getElementHealth(localPlayer) + 12 ) 
    local money = getPlayerMoney(localPlayer)
    if money >= 8 then
    takePlayerMoney(localPlayer, 8)
    outputChatBox (" Z maszyny wylatuje puszka z * Red Bull *")
    outputChatBox (" Wypi?e? * Red Bull * zap?aci?e? 8$")
    else
    outputChatBox("nie posiadasz funduszy")
    end
    end
end)

function Open_panel (el) 
    if el~=localPlayer then return end
    guiSetVisible(panel, true)
    guiSetVisible(addKamizelka, true)
    guiSetVisible(addUSPs, true)
    guiSetVisible(addM4A1S,true)
    guiSetVisible(addAK47,true)
    showCursor(true,false)
end 
addEventHandler ("onClientMarkerHit", marker, Open_panel) 

function Close_panel(el) 
if el~=localPlayer then return end
    guiSetVisible(panel, false)
    guiSetVisible(addKamizelka, false)
    guiSetVisible(addUSPs, false)
    guiSetVisible(addM4A1S,false)
    guiSetVisible(addAK47,false)
    showCursor (false,false) 
end 
addEventHandler ("onClientMarkerLeave",marker, Close_panel) 


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
guciopl5
Tagi: gui
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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