Jump to content

مشككلهه


Recommended Posts

Posted

السلام عليكم

انا عندي مشكلة

سويت كذا

function guiCreateWindow(x2, y2, width2, height2, titleBarText2, relative2) 
  local mainBackground = guiCreateStaticImage(x2, y2, width2, height2, "window.png", relative2) 
  local mainBackgroundLabel = guiCreateLabel(0, 0, 0, 0, titleBarText2, false, mainBackground) 
  guiSetEnabled(mainBackgroundLabel, false) 
  return mainBackground 
end 
  
function guiCreateButton( x2, y2, width2, height2, titleBarText2, relative2, ksa ) 
    local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "Button.png", relative2, ksa ) 
local w, h = guiGetSize ( mainBackground, false ) 
    local mainBackgroundLabel = guiCreateLabel ( x2, y2, w, h, titleBarText2, false, mainBackground ) 
    guiSetFont ( mainBackgroundLabel, font ) 
    guiSetEnabled ( mainBackgroundLabel, false ) 
     guiLabelSetHorizontalAlign(mainBackgroundLabel, "center") 
     guiLabelSetVerticalAlign(mainBackgroundLabel, "center") 
       guiLabelSetColor( mainBackgroundLabel, 255, 0, 0 ) 
addEventHandler( "onClientMouseEnter", root, 
function () 
    if source == mainBackground then 
            guiStaticImageLoadImage(mainBackground,"Button2.png") 
     guiLabelSetColor(mainBackgroundLabel, 255, 0, 0) 
        playSoundFrontEnd ( 3) 
    end 
end) 

المشكلة ههي ان التكست الي بالبتون ماتجي تجي صورة فاضيية

Posted

كامل واستبدله بـ ذا guiCreateButton امسح فنكشن

function guiCreateButton( x2, y2, width2, height2, titleBarText2, relative2, ksa ) 
    local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "Button.png", relative2, ksa ) 
    local w, h = guiGetSize ( mainBackground, false ) 
    local mainBackgroundLabel = guiCreateLabel ( x2, y2, w, h, titleBarText2, false, mainBackground ) 
    guiSetFont ( mainBackgroundLabel, font ) 
    guiSetEnabled ( mainBackgroundLabel, false ) 
    guiLabelSetHorizontalAlign(mainBackgroundLabel, "center") 
    guiLabelSetVerticalAlign(mainBackgroundLabel, "center") 
    guiLabelSetColor( mainBackgroundLabel, 255, 0, 0 ) 
end 
Posted (edited)

addEventHandler ( 'onClientResourceStart', resourceRoot, 
function  ( ) 
mainBackground = guiCreateStaticImage( 20, 200, 100, 100, "window.png", false ) 
Label = guiCreateLabel(0.02,0.04,0.94,0.92,"This is help text.",true,mainBackground) 
guiSetEnabled(Label, false) 
guiSetFont (Label, "default-normal") 
guiLabelSetHorizontalAlign(Label, "center") 
guiLabelSetVerticalAlign(Label, "center") 
guiLabelSetColor( Label, 255, 0, 0 ) 
  end 
) 
  
addEventHandler( "onClientMouseEnter", resourceRoot, 
function () 
    if ( localPlayer == mainBackground ) then 
     guiStaticImageLoadImage(mainBackground,"Button2.png") 
     guiLabelSetColor(Label, 255, 0, 0) 
     playSoundFrontEnd ( 3) 
   end 
end 
) 
Edited by Guest
Posted (edited)
addEventHandler ( 'onClientResourceStart', resourceRoot, 
function  ( ) 
mainBackground = guiCreateStaticImage( 20, 200, 100, 100, "window.png", false ) 
Label = guiCreateLabel(0.02,0.04,0.94,0.92,"This is help text.",true,mainBackground) 
guiSetEnabled(Label, false) 
guiSetFont (Label, font ) 
guiLabelSetHorizontalAlign(Label, "center") 
guiLabelSetVerticalAlign(Label, "center") 
guiLabelSetColor( Label, 255, 0, 0 ) 
  end 
) 
  
addEventHandler( "onClientMouseEnter", resourceRoot, 
function () 
    if ( localPlayer == mainBackground ) then 
     guiStaticImageLoadImage(mainBackground,"Button2.png") 
     guiLabelSetColor(Label, 255, 0, 0) 
     playSoundFrontEnd ( 3) 
   end 
end 
) 

مين قالك هو بسوي هيك

تفضل جرب

function guiCreateWindow(x2, y2, width2, height2, titleBarText2, relative2) 
  local mainBackground = guiCreateStaticImage(x2, y2, width2, height2, "window.png", relative2) 
  local mainBackgroundLabel = guiCreateLabel(0, 0, 0, 0, titleBarText2, false, mainBackground) 
  guiSetEnabled(mainBackgroundLabel, false) 
  return mainBackground 
end 
  
function guiCreateButton( x2, y2, width2, height2, titleBarText2, relative2, ksa ) 
    local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "Button.png", relative2, ksa ) 
    local w, h = guiGetSize ( mainBackground, false ) 
    local mainBackgroundLabel = guiCreateLabel ( x2, y2, w, h, titleBarText2, false, mainBackground ) 
    guiSetFont ( mainBackgroundLabel, font ) 
    guiSetEnabled ( mainBackgroundLabel, false ) 
    guiLabelSetHorizontalAlign(mainBackgroundLabel, "center") 
    guiLabelSetVerticalAlign(mainBackgroundLabel, "center") 
    guiLabelSetColor( mainBackgroundLabel, 255, 0, 0 ) 
end 
        
addEventHandler( "onClientMouseEnter", root, 
function () 
    if source == mainBackground then 
        guiStaticImageLoadImage(mainBackground,"Button2.png") 
        guiLabelSetColor(mainBackgroundLabel, 255, 0, 0) 
        playSoundFrontEnd ( 3) 
    end 
end) 

Edited by Guest
Posted
addEventHandler ( 'onClientResourceStart', resourceRoot, 
function  ( ) 
mainBackground = guiCreateStaticImage( 20, 200, 100, 100, "window.png", false ) 
Label = guiCreateLabel(0.02,0.04,0.94,0.92,"This is help text.",true,mainBackground) 
guiSetEnabled(Label, false) 
guiSetFont (Label, font ) 
guiLabelSetHorizontalAlign(Label, "center") 
guiLabelSetVerticalAlign(Label, "center") 
guiLabelSetColor( Label, 255, 0, 0 ) 
  end 
) 
  
addEventHandler( "onClientMouseEnter", resourceRoot, 
function () 
    if ( localPlayer == mainBackground ) then 
     guiStaticImageLoadImage(mainBackground,"Button2.png") 
     guiLabelSetColor(Label, 255, 0, 0) 
     playSoundFrontEnd ( 3) 
   end 
end 
) 

مين قالك خو بسوي هيك

تفضل جرب

function guiCreateWindow(x2, y2, width2, height2, titleBarText2, relative2) 
  local mainBackground = guiCreateStaticImage(x2, y2, width2, height2, "window.png", relative2) 
  local mainBackgroundLabel = guiCreateLabel(0, 0, 0, 0, titleBarText2, false, mainBackground) 
  guiSetEnabled(mainBackgroundLabel, false) 
  return mainBackground 
end 
  
function guiCreateButton( x2, y2, width2, height2, titleBarText2, relative2, ksa ) 
    local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "Button.png", relative2, ksa ) 
    local w, h = guiGetSize ( mainBackground, false ) 
    local mainBackgroundLabel = guiCreateLabel ( x2, y2, w, h, titleBarText2, false, mainBackground ) 
    guiSetFont ( mainBackgroundLabel, font ) 
    guiSetEnabled ( mainBackgroundLabel, false ) 
    guiLabelSetHorizontalAlign(mainBackgroundLabel, "center") 
    guiLabelSetVerticalAlign(mainBackgroundLabel, "center") 
    guiLabelSetColor( mainBackgroundLabel, 255, 0, 0 ) 
end 
        
addEventHandler( "onClientMouseEnter", root, 
function () 
    if source == mainBackground then 
        guiStaticImageLoadImage(mainBackground,"Button2.png") 
        guiLabelSetColor(mainBackgroundLabel, 255, 0, 0) 
        playSoundFrontEnd ( 3) 
    end 
end) 

باراميتر الصورة المطلوب 6

ممن وين جبت ksa ?

Posted
الكود الي يغير صورة الزر جبته من سكربت عندي

اي بارميتر ؟

جرب الكود حقي

استبدل

x , y

hight , width ..

باللي عندك وبس

Posted

هذا كودي بدون اي تعديل

نسيت احط onClientMouseLeave

    function guiCreateWindow(x2, y2, width2, height2, titleBarText2, relative2) 
      local mainBackground = guiCreateStaticImage(x2, y2, width2, height2, "window.png", relative2) 
      local mainBackgroundLabel = guiCreateLabel(0, 0, 0, 0, titleBarText2, false, mainBackground) 
      guiSetEnabled(mainBackgroundLabel, false) 
      return mainBackground 
    end 
      
    function guiCreateButton( x2, y2, width2, height2, titleBarText2, relative2, ksa ) 
        local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "Button.png", relative2, ksa ) 
        local w, h = guiGetSize ( mainBackground, false ) 
        local mainBackgroundLabel = guiCreateLabel ( x2, y2, w, h, titleBarText2, false, mainBackground ) 
        guiSetFont ( mainBackgroundLabel, font ) 
        guiSetEnabled ( mainBackgroundLabel, false ) 
        guiLabelSetHorizontalAlign(mainBackgroundLabel, "center") 
        guiLabelSetVerticalAlign(mainBackgroundLabel, "center") 
        guiLabelSetColor( mainBackgroundLabel, 255, 0, 0 ) 
    end 
            
    addEventHandler( "onClientMouseEnter", root, 
    function () 
        if source == mainBackground then 
            guiStaticImageLoadImage(mainBackground,"Button2.png") 
            guiLabelSetColor(mainBackgroundLabel, 255, 0, 0) 
            playSoundFrontEnd ( 3) 
        end 
    end) 
  
addEventHandler( "onClientGUIClick", root, 
function () 
    if source == mainBackground then 
        playSoundFrontEnd ( 19) 
    end 
end) 
  
addEventHandler( "onClientMouseLeave", root, 
function () 
    if source == mainBackground then 
                guiStaticImageLoadImage(mainBackground,"File/Button.png") 
       guiLabelSetColor( mainBackgroundLabel, 255, 0, 0 )    
    end 
end) 
    return mainBackground 

الاكواد حقتكم كل شوي يطلع مشكلة عند end واحذفها ثم يقول خطاء عند النافذه

Posted (edited)

addEventHandler ( 'onClientResourceStart', resourceRoot, 
function  ( ) 
mainBackground = guiCreateStaticImage( 20, 200, 100, 100, "window.png", false ) 
local mainBackground2 = guiCreateStaticImage ( 20, 200, 100, 100, "Button.png", false) 
Label = guiCreateLabel(0.02,0.04,0.94,0.92,"This is help text.",true,mainBackground) 
guiSetEnabled(Label, false) 
guiSetFont (Label, "default-normal") 
guiLabelSetHorizontalAlign(Label, "center") 
guiLabelSetVerticalAlign(Label, "center") 
guiLabelSetColor( Label, 255, 0, 0 ) 
  end 
) 
  
addEventHandler( "onClientMouseEnter", resourceRoot, 
function () 
    if ( localPlayer == mainBackground ) then 
     guiStaticImageLoadImage(mainBackground,"Button2.png") 
     guiLabelSetColor(Label, 255, 0, 0) 
     playSoundFrontEnd ( 3) 
   end 
end 
) 
  
addEventHandler( "onClientGUIClick", resourceRoot, 
function ( ) 
    if (localPlayer == mainBackground ) then 
        playSoundFrontEnd ( 19) 
    end 
end) 
  
  
addEventHandler( "onClientMouseLeave", resourceRoot, 
function ( ) 
    if (localPlayer == mainBackground ) then 
        guiStaticImageLoadImage(mainBackground,"File/Button.png") 
       guiLabelSetColor( mainBackgroundLabel, 255, 0, 0 )    
    end 
end) 

تأكد الكود كلينت . .

+

اذا الصور كلها في مجلد اسمه

File

لازم كل الصور تسوي لهم

File/'Button1'

File/'Button2'

... الخ

+ ياليت تستخدم الديبق وتقول لي وش يطلع لك اخطاء من كودي . .

Edited by Guest
Posted
شكلهه مهو زابط خلاصص ماعاد ابي اسويهه

مششكورين

اضغط السكربت وارفعه على موقع مع الصور وانا بضبطه لك وبرسله لك لاني ماعرف كم تبي صور

+ الفائدة من المود

ارسلي السكربت خاص اذا ماتقدر تحطه هنا

Posted
سطر 42 احذفه

@ Max : هريس -__-

وليه هريس بالله ؟

وش الخطأ ماشوف فيه شي . .

Posted
if ( localPlayer == mainBackground ) then !!!! ؟

طيب ذا اذا الاعب ضغط على الخلفيه ؟

وش فيه

كانك مسوي

if source == .. .

Posted
if ( localPlayer == mainBackground ) then !!!! ؟

طيب ذا اذا الاعب ضغط على الخلفيه ؟

وش فيه

كانك مسوي

if source == .. .

انت فاهم السورس خطأ

كل حدث يفرق عن الثاني وراجع الويكي عشان تعرف ايش السورس لحدث معين

هو الشي الي انضغط عليه و ليس الاعب الي ضغط على الشي onClientGUIClick السورس في الحدث

و اصلاً ما يصير اساساً تقارن لاعب ب زر

يعني يصير مثلاً تقارن ماكس == خلفية؟

انت خلفية؟ هههههه

Posted
if ( localPlayer == mainBackground ) then !!!! ؟

طيب ذا اذا الاعب ضغط على الخلفيه ؟

وش فيه

كانك مسوي

if source == .. .

انت فاهم السورس خطأ

كل حدث يفرق عن الثاني وراجع الويكي عشان تعرف ايش السورس لحدث معين

هو الشي الي انضغط عليه و ليس الاعب الي ضغط على الشي onClientGUIClick السورس في الحدث

و اصلاً ما يصير اساساً تقارن لاعب ب زر

يعني يصير مثلاً تقارن ماكس == خلفية؟

انت خلفية؟ هههههه

اها , واضح الحين

الله يعطيك العافية تبوله ماقصرت :)

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...