Jump to content

|طلب كود تغير خلفية المود|تم الافادة من برسسستيج


Recommended Posts

addEventHandler("onClientGUIClick",Button, 
function ( ) 
guiStaticImageLoadImage ( wnd, "اسم الملف.png" ) 
   end,false) 

هذا الكود يوم تضغط زر ومسوي صورة بـ اسم wnd

بيغيرها لـ صورة ثانية كذا صح؟ يوم تضغط زر Button

بيغير الصورة ذذ مثلا حط اي ملف وغيرها وجرب #

Link to comment

شوف ذا نفس الودك ياه لو ما عارفت تعمل اطرح كلنت حقك و اعمله لك لكن لزم صوره 1 و 2 نفس احداث المكان

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(285,15,249,509,"للل",false) 
guiSetVisible(GUIEditor_Window[1],false) 
guiSetAlpha(GUIEditor_Window[1],1) 
GUIEditor_Image[1] = guiCreateStaticImage(13,49,87,390,"yazan/jo1.png",false,GUIEditor_Window[1]) 
GUIEditor_Image[2] = guiCreateStaticImage(13,49,87,390,"yazan/jo2.png",false,GUIEditor_Window[1]) 
guiSetVisible(GUIEditor_Image[2],false) 
Button1 = guiCreateButton(9,451,231,48,"yaZan",false,GUIEditor_Window[1]) 
  
function open() 
    guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) 
    showCursor(guiGetVisible(GUIEditor_Window[1])) 
    guiSetInputEnabled(guiGetVisible(GUIEditor_Window[1])) 
end 
bindKey("F6","down",open) 
  
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if ( source == Button1 ) then 
            guiSetVisible(GUIEditor_Image[1],false) 
end true) 
            guiSetVisible(GUIEditor_Image[2],true) 
end false) 

Link to comment

لم يتم التجربة

aImage = { } 
  
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if source == Button then 
            if aImage [ img ] then 
                local img = guiStaticImageLoadImage ( wnd, "1.png" ) 
                aImage [ img ] = false 
            else 
                local img = guiStaticImageLoadImage ( wnd, "2.png" ) 
                aImage [ img ] = true 
            end 
        end 
    end 
) 

Link to comment
لم يتم التجربة
aImage = { } 
  
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if source == Button then 
            if aImage [ img ] then 
                local img = guiStaticImageLoadImage ( wnd, "1.png" ) 
                aImage [ img ] = false 
            else 
                local img = guiStaticImageLoadImage ( wnd, "2.png" ) 
                aImage [ img ] = true 
            end 
        end 
    end 
) 

م اشتغل

ذي النافذة

function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) 
    local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "1.png", relative2 ) 
    local mainBackgroundLabel = guiCreateLabel ( 0, 0, 250, 100, titleBarText2, false, mainBackground ) 
    guiSetFont ( mainBackgroundLabel, newFont ) 
    guiSetEnabled ( mainBackgroundLabel, false ) 
    return mainBackground 
end 
GUIEditor_Button = {} 
  
wnd = guiCreateWindow(158,60,579,479,"Music script By !FP^B_o~L|B|/\/",false) 
guiSetVisible(wnd, false) 
guiSetAlpha(wnd,1) 
GUIEditor_Button[1] = guiCreateButton(16,75,105,35,"Music",false,wnd) 
GUIEditor_Button[2] = guiCreateButton(230,75,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
GUIEditor_Button[3] = guiCreateButton(457,75,94,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[3],"default-bold-small") 
GUIEditor_Button[4] = guiCreateButton(16,75,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[4],"default-bold-small") 
GUIEditor_Button[5] = guiCreateButton(16,171,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[5],"default-bold-small") 
GUIEditor_Button[6] = guiCreateButton(230,171,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[6],"default-bold-small") 
GUIEditor_Button[7] = guiCreateButton(459,171,94,35,"Music",false,wnd) 
GUIEditor_Button[8] = guiCreateButton(16,274,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[8],"default-bold-small") 
GUIEditor_Button[9] = guiCreateButton(230,274,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[9],"default-bold-small") 
GUIEditor_Button[10] = guiCreateButton(453,274,103,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[10],"default-bold-small") 
GUIEditor_Button[11] = guiCreateButton(12,388,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[11],"default-bold-small") 
GUIEditor_Button[12] = guiCreateButton(234,388,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[12],"default-bold-small") 
GUIEditor_Button[13] = guiCreateButton(451,388,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[13],"default-bold-small") 
GUIEditor_Button[15] = guiCreateButton(379,22,74,30,"تغير الخلفية",false,wnd) 
guiSetFont(GUIEditor_Button[15],"default-bold-small") 
  
isMove = false 
  
bindKey("F9", "down", 
function() 
if isMove then return end 
if guiGetVisible( wnd ) then 
    guiSetVisible(wnd, false) 
    showCursor(false) 
else 
    guiSetPosition(wnd, -300, 54, false) 
    guiSetVisible(wnd, true) 
    showCursor(true) 
    if isTimer(Time) then 
        return 
    end 
    Time = setTimer(function() 
    local x, y = guiGetPosition(wnd, false) 
    guiSetPosition(wnd, x + 8, y, false) 
    end, 50, 50) 
    isWindowMove(true) 
    setTimer(isWindowMove, 100, 1, false) 
end 
end 
) 
  
  
function isWindowMove(bole) 
isMove = bole 
end 

Edited by Guest
Link to comment
تبية مثلا يضغط مرة ويضغط مرة ترجع او بس مرة وحدة يغيرها ولا يقدر يرجعها ذذ ؟؟

لا يقدر يرجعها يعني يضغط تتحول الصورة يضغط مرة ثانية ترجع الصورة الاولى

Link to comment

جرب الكود مختلف عن عناد تماما ذذ :

function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) 
    mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "1.png", relative2 ) 
    local mainBackgroundLabel = guiCreateLabel ( 0, 0, 250, 100, titleBarText2, false, mainBackground ) 
    guiSetEnabled ( mainBackgroundLabel, false ) 
    return mainBackground 
end 
GUIEditor_Button = {} 
  
wnd = guiCreateWindow(158,60,579,479,"Music script By !FP^B_o~L|B|/\/",false) 
guiSetVisible(wnd, false) 
guiSetAlpha(wnd,1) 
GUIEditor_Button[1] = guiCreateButton(16,75,105,35,"Music",false,wnd) 
GUIEditor_Button[2] = guiCreateButton(230,75,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
GUIEditor_Button[3] = guiCreateButton(457,75,94,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[3],"default-bold-small") 
GUIEditor_Button[4] = guiCreateButton(16,75,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[4],"default-bold-small") 
GUIEditor_Button[5] = guiCreateButton(16,171,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[5],"default-bold-small") 
GUIEditor_Button[6] = guiCreateButton(230,171,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[6],"default-bold-small") 
GUIEditor_Button[7] = guiCreateButton(459,171,94,35,"Music",false,wnd) 
GUIEditor_Button[8] = guiCreateButton(16,274,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[8],"default-bold-small") 
GUIEditor_Button[9] = guiCreateButton(230,274,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[9],"default-bold-small") 
GUIEditor_Button[10] = guiCreateButton(453,274,103,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[10],"default-bold-small") 
GUIEditor_Button[11] = guiCreateButton(12,388,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[11],"default-bold-small") 
GUIEditor_Button[12] = guiCreateButton(234,388,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[12],"default-bold-small") 
GUIEditor_Button[13] = guiCreateButton(451,388,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[13],"default-bold-small") 
GUIEditor_Button[15] = guiCreateButton(379,22,74,30,"تغير الخلفية",false,wnd) 
guiSetFont(GUIEditor_Button[15],"default-bold-small") 
  
isMove = false 
  
bindKey("F9", "down", 
function() 
if isMove then return end 
if guiGetVisible( wnd ) then 
    guiSetVisible(wnd, false) 
    showCursor(false) 
else 
    guiSetPosition(wnd, -300, 54, false) 
    guiSetVisible(wnd, true) 
    showCursor(true) 
    if isTimer(Time) then 
        return 
    end 
    Time = setTimer(function() 
    local x, y = guiGetPosition(wnd, false) 
    guiSetPosition(wnd, x + 8, y, false) 
    end, 50, 50) 
    isWindowMove(true) 
    setTimer(isWindowMove, 100, 1, false) 
end 
end 
) 
  
  
function isWindowMove(bole) 
isMove = bole 
end 
  
local load = false 
  
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if source == GUIEditor_Button[15] then 
                        guiStaticImageLoadImage(mainBackground,load and "1.png" or "2.png")      
            load = not load 
        end 
    end 
) 

اسم الصورهـ الثانية :

2.png

Link to comment
جرب الكود مختلف عن عناد تماما ذذ :

function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) 
    mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "1.png", relative2 ) 
    local mainBackgroundLabel = guiCreateLabel ( 0, 0, 250, 100, titleBarText2, false, mainBackground ) 
    guiSetEnabled ( mainBackgroundLabel, false ) 
    return mainBackground 
end 
GUIEditor_Button = {} 
  
wnd = guiCreateWindow(158,60,579,479,"Music script By !FP^B_o~L|B|/\/",false) 
guiSetVisible(wnd, false) 
guiSetAlpha(wnd,1) 
GUIEditor_Button[1] = guiCreateButton(16,75,105,35,"Music",false,wnd) 
GUIEditor_Button[2] = guiCreateButton(230,75,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
GUIEditor_Button[3] = guiCreateButton(457,75,94,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[3],"default-bold-small") 
GUIEditor_Button[4] = guiCreateButton(16,75,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[4],"default-bold-small") 
GUIEditor_Button[5] = guiCreateButton(16,171,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[5],"default-bold-small") 
GUIEditor_Button[6] = guiCreateButton(230,171,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[6],"default-bold-small") 
GUIEditor_Button[7] = guiCreateButton(459,171,94,35,"Music",false,wnd) 
GUIEditor_Button[8] = guiCreateButton(16,274,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[8],"default-bold-small") 
GUIEditor_Button[9] = guiCreateButton(230,274,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[9],"default-bold-small") 
GUIEditor_Button[10] = guiCreateButton(453,274,103,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[10],"default-bold-small") 
GUIEditor_Button[11] = guiCreateButton(12,388,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[11],"default-bold-small") 
GUIEditor_Button[12] = guiCreateButton(234,388,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[12],"default-bold-small") 
GUIEditor_Button[13] = guiCreateButton(451,388,105,35,"Music",false,wnd) 
guiSetFont(GUIEditor_Button[13],"default-bold-small") 
GUIEditor_Button[15] = guiCreateButton(379,22,74,30,"تغير الخلفية",false,wnd) 
guiSetFont(GUIEditor_Button[15],"default-bold-small") 
  
isMove = false 
  
bindKey("F9", "down", 
function() 
if isMove then return end 
if guiGetVisible( wnd ) then 
    guiSetVisible(wnd, false) 
    showCursor(false) 
else 
    guiSetPosition(wnd, -300, 54, false) 
    guiSetVisible(wnd, true) 
    showCursor(true) 
    if isTimer(Time) then 
        return 
    end 
    Time = setTimer(function() 
    local x, y = guiGetPosition(wnd, false) 
    guiSetPosition(wnd, x + 8, y, false) 
    end, 50, 50) 
    isWindowMove(true) 
    setTimer(isWindowMove, 100, 1, false) 
end 
end 
) 
  
  
function isWindowMove(bole) 
isMove = bole 
end 
  
local load = false 
  
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if source == GUIEditor_Button[15] then 
                        guiStaticImageLoadImage(mainBackground,load and "1.png" or "2.png")      
            load = not load 
        end 
    end 
) 

اسم الصورهـ الثانية :

2.png

اشتغل مشكوور

وربي ابداع :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...