-#Saimon Posted August 1, 2014 Share Posted August 1, 2014 السلام عليكم ورحمة الله وبركاته ي شبآب انا بسوي طريقة آستبدال الزر الى صوره واذا الاعب اشر على الصور تتغير الى صوره آخرى واذا ضغط عليها تتغير الى صوره ثآلثه لكن انا عندي فوق 20 زر ف صعبه آجلس احط لكل زر كود لحاله مآفي طريقه استبدال الصوره بوآسطة الاسم .؟ Img2.png يبدلها الى img1.png مثلاَ يتحقق اذا الاعب لمس الصوره Link to comment
#DRAGON!FIRE Posted August 1, 2014 Share Posted August 1, 2014 تقصد ازرار السيرفر كلها ؟ ولا بس السكربت نفسه ! Link to comment
-#Saimon Posted August 1, 2014 Author Share Posted August 1, 2014 تقصد ازرار السيرفر كلها ؟ ولا بس السكربت نفسه ! بس السكربت نفسه Link to comment
#DRAGON!FIRE Posted August 1, 2014 Share Posted August 1, 2014 ممكن توضح اكثر .. تبي تبدلهم لـ صور .. ويوم يدخل المؤشر للصور ذي تجي صورة ثانية ! ؟ .. GUI تقصد مثلأ عندكـ ازرار Link to comment
-#Saimon Posted August 1, 2014 Author Share Posted August 1, 2014 ممكن توضح اكثر ..تبي تبدلهم لـ صور .. ويوم يدخل المؤشر للصور ذي تجي صورة ثانية ! ؟ .. GUI تقصد مثلأ عندكـ ازرار يب + اذا ضغط عليهم تتبدل الى صوره ثآلثه Link to comment
#DRAGON!FIRE Posted August 1, 2014 Share Posted August 1, 2014 جرب كذا ولا تنسى تحط اسم ومسار الصورة .. : local OrginalImage = "" --- الصورة الاصلية # local onEnter = "" --- عند دخول المؤشر # local onClick = "" --- عند الضغط على الصورة # addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _,guiElements in ipairs ( getElementsByType ( "gui-button", resourceRoot ) ) do local _x, _y = guiGetPosition ( guiElements, false ) local _w, _h = guiGetSize ( guiElements, false ) replaceimage = guiCreateStaticImage( _x, _y, _w, _h, OrginalImage, false ) if ( replaceimage ) then guiSetAlpha ( guiElements, 0 ) addEventHandler( "onClientMouseEnter", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onEnter ) end, false ) addEventHandler( "onClientMouseLeave", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, OrginalImage ) end, false ) addEventHandler( "onClientGUIClick", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onClick ) end, false ) end end end ) Link to comment
-#Saimon Posted August 1, 2014 Author Share Posted August 1, 2014 سويت كذا ولا زبط local OrginalImage = "imgorg.png" local onEnter = "imgenter.png" local onClick = "imgclick.png" addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _,guiElements in ipairs ( getElementsByType ( "gui-button", resourceRoot ) ) do local _x, _y = guiGetPosition ( guiElements, false ) local _w, _h = guiGetSize ( guiElements, false ) replaceimage = guiCreateStaticImage( _x, _y, _w, _h, OrginalImage, false ) if ( replaceimage ) then guiSetAlpha ( guiElements, 0 ) addEventHandler( "onClientMouseEnter", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onEnter ) end, false ) addEventHandler( "onClientMouseLeave", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, OrginalImage ) end, false ) addEventHandler( "onClientGUIClick", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onClick ) end, false ) end end end ) GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(389, 223, 569, 467, "T Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF1C78F2") GUIEditor.button[1] = guiCreateButton(197, 395, 188, 46, "T Now", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetVisible(GUIEditor.window[1],false) end ) bindKey("F5","down",function() if guiGetVisible(GUIEditor.window[1]) == true then guiSetVisible(GUIEditor.window[1],false) showCursor(false) else guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end) Link to comment
AboShanab Posted August 1, 2014 Share Posted August 1, 2014 خل الكود حق زاحف بالنهاية Link to comment
iMr.TZ[W]ER Posted August 1, 2014 Share Posted August 1, 2014 سويت كذا ولا زبط GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } local OrginalImage = "imgorg.png" local onEnter = "imgenter.png" local onClick = "imgclick.png" addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _,guiElements in ipairs ( getElementsByType ( "gui-button", resourceRoot ) ) do local _x, _y = guiGetPosition ( guiElements, false ) local _w, _h = guiGetSize ( guiElements, false ) replaceimage = guiCreateStaticImage( _x, _y, _w, _h, OrginalImage, false ) if ( replaceimage ) then guiSetAlpha ( guiElements, 0 ) addEventHandler( "onClientMouseEnter", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onEnter ) end, false ) addEventHandler( "onClientMouseLeave", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, OrginalImage ) end, false ) addEventHandler( "onClientGUIClick", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onClick ) end, false ) end end end ) addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(389, 223, 569, 467, "T Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF1C78F2") GUIEditor.button[1] = guiCreateButton(197, 395, 188, 46, "T Now", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetVisible(GUIEditor.window[1],false) end ) bindKey("F5","down",function() if guiGetVisible(GUIEditor.window[1]) == true then guiSetVisible(GUIEditor.window[1],false) showCursor(false) else guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end) جرب Link to comment
-#Saimon Posted August 1, 2014 Author Share Posted August 1, 2014 سويت كذا ولا زبط GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } local OrginalImage = "imgorg.png" local onEnter = "imgenter.png" local onClick = "imgclick.png" addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _,guiElements in ipairs ( getElementsByType ( "gui-button", resourceRoot ) ) do local _x, _y = guiGetPosition ( guiElements, false ) local _w, _h = guiGetSize ( guiElements, false ) replaceimage = guiCreateStaticImage( _x, _y, _w, _h, OrginalImage, false ) if ( replaceimage ) then guiSetAlpha ( guiElements, 0 ) addEventHandler( "onClientMouseEnter", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onEnter ) end, false ) addEventHandler( "onClientMouseLeave", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, OrginalImage ) end, false ) addEventHandler( "onClientGUIClick", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onClick ) end, false ) end end end ) addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(389, 223, 569, 467, "T Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF1C78F2") GUIEditor.button[1] = guiCreateButton(197, 395, 188, 46, "T Now", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetVisible(GUIEditor.window[1],false) end ) bindKey("F5","down",function() if guiGetVisible(GUIEditor.window[1]) == true then guiSetVisible(GUIEditor.window[1],false) showCursor(false) else guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end) جرب نفس الشي Link to comment
-#Saimon Posted August 1, 2014 Author Share Posted August 1, 2014 خل الكود حق زاحف بالنهاية زبط , بس الصور ماتجي باللوحه تجي برا Link to comment
iMr.TZ[W]ER Posted August 1, 2014 Share Posted August 1, 2014 خل الكود حق زاحف بالنهاية زبط , بس الصور ماتجي باللوحه تجي برا استخدم كود حسن اللي يخلي كل شي مقاساته تجي على مقاس الشاشة او سوي صور وريح راسك Link to comment
shwaeki Posted August 1, 2014 Share Posted August 1, 2014 جرب local OrginalImage = "" --- الصورة الاصلية # local onEnter = "" --- عند دخول المؤشر # local onClick = "" --- عند الضغط على الصورة # addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _,guiElements in ipairs ( getElementsByType ( "gui-button", resourceRoot ) ) do local _x, _y = guiGetPosition ( guiElements, false ) local _w, _h = guiGetSize ( guiElements, false ) replaceimage = guiCreateStaticImage( _x, _y, _w, _h, OrginalImage, false ,GUIEditor.window[1] ) if ( replaceimage ) then guiSetAlpha ( guiElements, 0 ) addEventHandler( "onClientMouseEnter", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onEnter ) end, false ) addEventHandler( "onClientMouseLeave", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, OrginalImage ) end, false ) addEventHandler( "onClientGUIClick", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onClick ) end, false ) end end end ) Link to comment
-#Saimon Posted August 1, 2014 Author Share Posted August 1, 2014 خل الكود حق زاحف بالنهاية زبط , بس الصور ماتجي باللوحه تجي برا استخدم كود حسن اللي يخلي كل شي مقاساته تجي على مقاس الشاشة او سوي صور وريح راسك المشكله آن الصوره ماتجي بالنافذه مره وحده ! مو ع المقاس مدري آذا يلزم تغغرات بالكود , مثل اسم النافذه Link to comment
-#Saimon Posted August 1, 2014 Author Share Posted August 1, 2014 الميتا ؟ الكود شغآل والصور شغاله ! بس الصوره ماتجي داخل النافذه كآني مسويها ع الشاشه "Unknow" type="script" version="2.1" /> Link to comment
iMr.TZ[W]ER Posted August 1, 2014 Share Posted August 1, 2014 تأكد من انك حاطط الصورة داخل اللوحة يعني لما تسويها بالجي يو اي اديتور لما تبي تحط الصورة اضغط كلك يمين داخل اللوحة بعدين حط صورة Link to comment
-#Saimon Posted August 1, 2014 Author Share Posted August 1, 2014 تأكد من انك حاطط الصورة داخل اللوحةيعني لما تسويها بالجي يو اي اديتور لما تبي تحط الصورة اضغط كلك يمين داخل اللوحة بعدين حط صورة انا مآسويت صوره أصلاَ , مسوي زر , الكود يبدل الزر الى صوره Link to comment
shwaeki Posted August 1, 2014 Share Posted August 1, 2014 (edited) تفضل شغال %100 GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(389, 223, 569, 467, "T Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF1C78F2") GUIEditor.button[1] = guiCreateButton(197, 395, 188, 46, "T Now", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetVisible(GUIEditor.window[1],false) end ) local OrginalImage = "imgorg.png" local onEnter = "imgenter.png" local onClick = "imgclick.png" addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _,guiElements in ipairs ( getElementsByType ( "gui-button", resourceRoot ) ) do local _x, _y = guiGetPosition ( guiElements, false ) local _w, _h = guiGetSize ( guiElements, false ) replaceimage = guiCreateStaticImage( _x, _y, _w, _h, OrginalImage, false ,GUIEditor.window[1]) if ( replaceimage ) then guiSetAlpha ( guiElements, 0 ) addEventHandler( "onClientMouseEnter", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onEnter ) end, false ) addEventHandler( "onClientMouseLeave", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, OrginalImage ) end, false ) addEventHandler( "onClientGUIClick", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onClick ) end, false ) end end end ) bindKey("F5","down",function() if guiGetVisible(GUIEditor.window[1]) == true then guiSetVisible(GUIEditor.window[1],false) showCursor(false) else guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end) Edited August 1, 2014 by Guest Link to comment
iMr.TZ[W]ER Posted August 1, 2014 Share Posted August 1, 2014 اللي هو المهم يكون العنصر داخل اللوحة ورينا واحد من ازرار اللوحة Link to comment
shwaeki Posted August 1, 2014 Share Posted August 1, 2014 اللي هوالمهم يكون العنصر داخل اللوحة ورينا واحد من ازرار اللوحة كل ردوكد مالها داعي Link to comment
-#Saimon Posted August 1, 2014 Author Share Posted August 1, 2014 (edited) تفضلشغال %100 GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(389, 223, 569, 467, "T Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF1C78F2") GUIEditor.button[1] = guiCreateButton(197, 395, 188, 46, "T Now", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetVisible(GUIEditor.window[1],false) end ) local OrginalImage = "imgorg.png" local onEnter = "imgenter.png" local onClick = "imgclick.png" addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _,guiElements in ipairs ( getElementsByType ( "gui-button", resourceRoot ) ) do local _x, _y = guiGetPosition ( guiElements, false ) local _w, _h = guiGetSize ( guiElements, false ) replaceimage = guiCreateStaticImage( _x, _y, _w, _h, OrginalImage, false ,GUIEditor.window[1]) if ( replaceimage ) then guiSetAlpha ( guiElements, 0 ) addEventHandler( "onClientMouseEnter", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onEnter ) end, false ) addEventHandler( "onClientMouseLeave", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, OrginalImage ) end, false ) addEventHandler( "onClientGUIClick", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onClick ) end, false ) end end end ) bindKey("F5","down",function() if guiGetVisible(GUIEditor.window[1]) == true then guiSetVisible(GUIEditor.window[1],false) showCursor(false) else guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end) مشششكور آشتغل , آششكر كل من شارك بالموضوع <3 #edit آخوي ي ليت تقول وش سويت وآشتتغل , عشان استععمله على مودات اخرى Edited August 1, 2014 by Guest Link to comment
-#Saimon Posted August 1, 2014 Author Share Posted August 1, 2014 العفو آخوي ي ليت تقول وش سويت وآشتتغل , عشان استععمله على مودات اخرى Link to comment
shwaeki Posted August 1, 2014 Share Posted August 1, 2014 انا عدتلك على الكود يلي اعطاك اياه زاحف local OrginalImage = "imgorg.png" local onEnter = "imgenter.png" local onClick = "imgclick.png" addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _,guiElements in ipairs ( getElementsByType ( "gui-button", resourceRoot ) ) do local _x, _y = guiGetPosition ( guiElements, false ) local _w, _h = guiGetSize ( guiElements, false ) replaceimage = guiCreateStaticImage( _x, _y, _w, _h, OrginalImage, false ,GUIEditor.window[1]) if ( replaceimage ) then guiSetAlpha ( guiElements, 0 ) addEventHandler( "onClientMouseEnter", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onEnter ) end, false ) addEventHandler( "onClientMouseLeave", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, OrginalImage ) end, false ) addEventHandler( "onClientGUIClick", replaceimage, function ( ) guiStaticImageLoadImage ( replaceimage, onClick ) end, false ) end end end ) شوف هاي كانت هيك replaceimage = guiCreateStaticImage( _x, _y, _w, _h, OrginalImage, false) سيوتها هيك replaceimage = guiCreateStaticImage( _x, _y, _w, _h, OrginalImage, false ,GUIEditor.window[1]) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now