[YARDIM] Scripte Resim Ekleme

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı flash

  • s
  • Yeni Üye
  • *
    • İleti: 32
: 26 Ocak 2018, 16:11:49
Arkadaşlar nasıl script'te resim eklerim ? kimse doğru düzgün anlatmıyor.
« Son Düzenleme: 28 Ocak 2018, 19:12:40 Gönderen: Narkoz »
 


MTASATURK

[YARDIM] Scripte Resim Ekleme
« : 26 Ocak 2018, 16:11:49 »

Çevrimdışı ByCash

  • Admin
  • *
    • İleti: 986
Yanıtla #1 : 26 Ocak 2018, 16:28:42
client.lua
Kod: lua
degiskenadi_ = guiCreateStaticImage(x, y, xy, xz, "resimadi.png", false)
meta.xml
Kod: lua
<meta>
<file src="resimadi.png"/>
</meta>
 


Çevrimdışı flash

  • s
  • Yeni Üye
  • *
    • İleti: 32
Yanıtla #2 : 26 Ocak 2018, 16:52:11
Script baslamıyor.

Client.lua
Kod: lua
    window = guiCreateWindow(427, 207, 435, 325, "Para Alma Paneli - Flash", false)
guiSetVisible(window, false)
        button = guiCreateButton(84, 59, 265, 154, "Para Al", false, window)
        guiSetFont(button, "sa-header")
        guiSetProperty(button, "NormalTextColour", "FFAAAAAA")
        button2 = guiCreateButton(158, 267, 127, 48, "Kapat", false, window)
        guiSetProperty(button2, "NormalTextColour", "FFAAAAAA")   
 
addEventHandler("onClientGUIClick", root, function()
    if source ==  button2 then -- eğer tıklanan element button2 ise
        guiSetVisible(window, false) -- paneli kapa
        showCursor(false) -- imleci kapa
   elseif source == button then -- eğer tıklanan element button isElement
        --setPlayerMoney(99999) --client tarafında bu fonksiyonu kullanırsan oyuncunun parası sadece oyuncuda değişmiş gözükür.
       triggerServerEvent("paraAl", localPlayer, 999999999) -- servera yolluyoruz
    end
end)

 
function panelacx ( )   
     button = guiCreateStaticImage(173, 255, 47, "button.png", false)     
        if ( guiGetVisible ( window ) == true ) then             
                guiSetVisible ( window, false )
                showCursor(false)
        else             
                guiSetVisible ( window, true )
                showCursor(true)
        end
end
addCommandHandler ("paraal", panelacx )

Server.lua
Kod: lua
addEvent ( "paraAl" ,  true ) 
addEventHandler ( "paraAl" , root,
function()
   givePlayerMoney(source, 999999999)
   outputChatBox ( "999999999 Tl aldın." , source,  0 , 255 , 0 ,  true )
end)
 


Çevrimdışı ByCash

  • Admin
  • *
    • İleti: 986
Yanıtla #3 : 26 Ocak 2018, 17:10:19
client.lua;
meta.xml ye button.png ve panel.png yi eklemeyi unutma.
Kod: lua
window = guiCreateStaticImage(427, 207, 435, 325, "resim/panel.png", false)
guiSetVisible(window, false)

button = guiCreateStaticImage(84, 59, 265, 154, "resim/button.png", false, window)
button_label = guiCreateLabel(5, 5, 265, 154, "Kapat", false, button)
guiSetFont(button_label, "default-bold-small")

button2 = guiCreateStaticImage(158, 267, 127, 48, "resim/button.png", false, window)
button2_label = guiCreateLabel(5, 5, 127, 78, "Para Al", false, button2)
guiSetFont(button2_label, "default-bold-small")

addEventHandler("onClientGUIClick", root,
function()
if source ==  button_label then
guiSetVisible(window, false)
showCursor(false)
if source == button2_label then
triggerServerEvent("paraAl", getLocalPlayer(), 999999999)
end
end
end)

addCommandHandler("paraal",
function()       
guiSetVisible(window, true)
showCursor(true)
end)
« Son Düzenleme: 26 Ocak 2018, 18:04:42 Gönderen: ByCash »