Jump to content

حل مشكلة كود اضفاء شخصية


Recommended Posts

انا بدي اسوي  لوحة اضفاءء شخصية 

وين خطا هنا

addEventHandler("onClientGUIClick",root,
function()
if source == GUIEditor.button[1] then -- هنا يتحققق بأن الشيء اللي نبيه يشتغل عليه الحدث هو الزر حق الاغلاق 
 -- هنا يغلق اللوحة ويشيل المؤشر بعد مايتحقق من الشرط
    zfljal6ery222 = true
    skin = engineLoadTXD ( "skins/13.txd" ) --bleedin eyes 31 by Slothman
    engineImportTXD ( skin, 13 )
    skin = engineLoadTXD ( "skins/22.txd" ) -- slashed 12 by Wall-E
    engineImportTXD ( skin, 22 )    
    skin = engineLoadTXD ( "skins/56.txd" ) --young and blue by Slothman
    engineImportTXD ( skin, 56 )
    skin = engineLoadTXD ( "skins/67.txd" ) -- slit r* employee
    engineImportTXD ( skin, 67 )
    skin = engineLoadTXD ( "skins/68.txd" ) -- shredded preist by Deixell
    engineImportTXD ( skin, 68 )
    skin = engineLoadTXD ( "skins/69.txd" ) --bleedin eyes in denim by Capitanazop
    engineImportTXD ( skin, 69 )
    skin = engineLoadTXD ( "skins/70.txd" ) --ultra gory scientist by 50p
    engineImportTXD ( skin, 70 )
    skin = engineLoadTXD ( "skins/84.txd" ) --guitar wolf (nonzombie) by Slothman
    engineImportTXD ( skin, 84 )
    skin = engineLoadTXD ( "skins/92.txd" ) -- peeled flesh by xbost
    engineImportTXD ( skin, 92 )
    skin = engineLoadTXD ( "skins/97.txd" ) -- easterboy by Slothman
    engineImportTXD ( skin, 97 )
    skin = engineLoadTXD ( "skins/105.txd" ) --Scarred Grove Gangster by Wall-E
    engineImportTXD ( skin, 105 )
    skin = engineLoadTXD ( "skins/107.txd" ) --ripped and slashed grove by Wall-E
    engineImportTXD ( skin, 107 )
    skin = engineLoadTXD ( "skins/108.txd" ) -- skeleton thug by Deixell
    engineImportTXD ( skin, 108 )
    skin = engineLoadTXD ( "skins/111.txd" ) --Frank West from dead rising (nonzombie) by Slothman
    engineImportTXD ( skin, 111 )
    skin = engineLoadTXD ( "skins/126.txd" ) -- bullet ridden wiseguy by Slothman
    engineImportTXD ( skin, 126 )
    skin = engineLoadTXD ( "skins/127.txd" ) --flyboy from dawn of the dead by Slothman
    engineImportTXD ( skin, 127 )
    skin = engineLoadTXD ( "skins/128.txd" ) --holy native by Slothman
    engineImportTXD ( skin, 128 )
    skin = engineLoadTXD ( "skins/152.txd" ) --bitten schoolgirl by Slothman
    engineImportTXD ( skin, 152 )
    skin = engineLoadTXD ( "skins/162.txd" ) --shirtless redneck by Slothman
    engineImportTXD ( skin, 162 )
    skin = engineLoadTXD ( "skins/167.txd" ) --dead chickenman by 50p
    engineImportTXD ( skin, 167 )
    skin = engineLoadTXD ( "skins/188.txd" ) --burnt greenshirt by Slothman
    engineImportTXD ( skin, 188 )
    skin = engineLoadTXD ( "skins/192.txd" ) --Alice from resident evil (nonzombie) by Slothman
    engineImportTXD ( skin, 192 )
    skin = engineLoadTXD ( "skins/195.txd" ) --bloody ex by Slothman
    engineImportTXD ( skin, 195 )
    skin = engineLoadTXD ( "skins/206.txd" ) -- faceless zombie by Slothman
    engineImportTXD ( skin, 206 )
    skin = engineLoadTXD ( "skins/209.txd" ) --Noodle vendor by 50p
    engineImportTXD ( skin, 209 )
    skin = engineLoadTXD ( "skins/212.txd" ) --brainy hobo by Slothman
    engineImportTXD ( skin, 212 )
    skin = engineLoadTXD ( "skins/229.txd" ) --infected tourist by Slothman
    engineImportTXD ( skin, 229 )
    skin = engineLoadTXD ( "skins/230.txd" ) --will work for brains hobo by Slothman
    engineImportTXD ( skin, 230 )
    skin = engineLoadTXD ( "skins/258.txd" ) --bloody sided suburbanite by Slothman
    engineImportTXD ( skin, 258 )
    skin = engineLoadTXD ( "skins/264.txd" ) --scary clown by 50p
    engineImportTXD ( skin, 264 )
    skin = engineLoadTXD ( "skins/274.txd" ) --Ash Williams (nonzombie) by Slothman
    engineImportTXD ( skin, 274 )
    skin = engineLoadTXD ( "skins/277.txd" ) -- gutted firefighter by Wall-E
    engineImportTXD ( skin, 277 )
    skin = engineLoadTXD ( "skins/280.txd" ) --infected cop by Lordy
    engineImportTXD ( skin, 280 )
    skin = engineLoadTXD ( "skins/287.txd" ) --torn army by Deixell
    engineImportTXD ( skin, 287 )
    else
    zfljal6ery222 = false
    skin = engineLoadTXD ( "skins/13.txd" ) --bleedin eyes 31 by Slothman
    engineImportTXD ( skin, 13 )
    skin = engineLoadTXD ( "skins/22.txd" ) -- slashed 12 by Wall-E
    engineImportTXD ( skin, 22 )    
    skin = engineLoadTXD ( "skins/56.txd" ) --young and blue by Slothman
    engineImportTXD ( skin, 56 )
    skin = engineLoadTXD ( "skins/67.txd" ) -- slit r* employee
    engineImportTXD ( skin, 67 )
    skin = engineLoadTXD ( "skins/68.txd" ) -- shredded preist by Deixell
    engineImportTXD ( skin, 68 )
    skin = engineLoadTXD ( "skins/69.txd" ) --bleedin eyes in denim by Capitanazop
    engineImportTXD ( skin, 69 )
    skin = engineLoadTXD ( "skins/70.txd" ) --ultra gory scientist by 50p
    engineImportTXD ( skin, 70 )
    skin = engineLoadTXD ( "skins/84.txd" ) --guitar wolf (nonzombie) by Slothman
    engineImportTXD ( skin, 84 )
    skin = engineLoadTXD ( "skins/92.txd" ) -- peeled flesh by xbost
    engineImportTXD ( skin, 92 )
    skin = engineLoadTXD ( "skins/97.txd" ) -- easterboy by Slothman
    engineImportTXD ( skin, 97 )
    skin = engineLoadTXD ( "skins/105.txd" ) --Scarred Grove Gangster by Wall-E
    engineImportTXD ( skin, 105 )
    skin = engineLoadTXD ( "skins/107.txd" ) --ripped and slashed grove by Wall-E
    engineImportTXD ( skin, 107 )
    skin = engineLoadTXD ( "skins/108.txd" ) -- skeleton thug by Deixell
    engineImportTXD ( skin, 108 )
    skin = engineLoadTXD ( "skins/111.txd" ) --Frank West from dead rising (nonzombie) by Slothman
    engineImportTXD ( skin, 111 )
    skin = engineLoadTXD ( "skins/126.txd" ) -- bullet ridden wiseguy by Slothman
    engineImportTXD ( skin, 126 )
    skin = engineLoadTXD ( "skins/127.txd" ) --flyboy from dawn of the dead by Slothman
    engineImportTXD ( skin, 127 )
    skin = engineLoadTXD ( "skins/128.txd" ) --holy native by Slothman
    engineImportTXD ( skin, 128 )
    skin = engineLoadTXD ( "skins/152.txd" ) --bitten schoolgirl by Slothman
    engineImportTXD ( skin, 152 )
    skin = engineLoadTXD ( "skins/162.txd" ) --shirtless redneck by Slothman
    engineImportTXD ( skin, 162 )
    skin = engineLoadTXD ( "skins/167.txd" ) --dead chickenman by 50p
    engineImportTXD ( skin, 167 )
    skin = engineLoadTXD ( "skins/188.txd" ) --burnt greenshirt by Slothman
    engineImportTXD ( skin, 188 )
    skin = engineLoadTXD ( "skins/192.txd" ) --Alice from resident evil (nonzombie) by Slothman
    engineImportTXD ( skin, 192 )
    skin = engineLoadTXD ( "skins/195.txd" ) --bloody ex by Slothman
    engineImportTXD ( skin, 195 )
    skin = engineLoadTXD ( "skins/206.txd" ) -- faceless zombie by Slothman
    engineImportTXD ( skin, 206 )
    skin = engineLoadTXD ( "skins/209.txd" ) --Noodle vendor by 50p
    engineImportTXD ( skin, 209 )
    skin = engineLoadTXD ( "skins/212.txd" ) --brainy hobo by Slothman
    engineImportTXD ( skin, 212 )
    skin = engineLoadTXD ( "skins/229.txd" ) --infected tourist by Slothman
    engineImportTXD ( skin, 229 )
    skin = engineLoadTXD ( "skins/230.txd" ) --will work for brains hobo by Slothman
    engineImportTXD ( skin, 230 )
    skin = engineLoadTXD ( "skins/258.txd" ) --bloody sided suburbanite by Slothman
    engineImportTXD ( skin, 258 )
    skin = engineLoadTXD ( "skins/264.txd" ) --scary clown by 50p
    engineImportTXD ( skin, 264 )
    skin = engineLoadTXD ( "skins/274.txd" ) --Ash Williams (nonzombie) by Slothman
    engineImportTXD ( skin, 274 )
    skin = engineLoadTXD ( "skins/277.txd" ) -- gutted firefighter by Wall-E
    engineImportTXD ( skin, 277 )
    skin = engineLoadTXD ( "skins/280.txd" ) --infected cop by Lordy
    engineImportTXD ( skin, 280 )
    skin = engineLoadTXD ( "skins/287.txd" ) --torn army by Deixell
    engineImportTXD ( skin, 287 )
end -- نهاية 
end -- ..
) -- اقفال الحدث

 

Edited by !#NssoR_)
إضافة الفنكشنات في محرر الاكواد لعرضها بشكل افضل
Link to comment

استعمل الوظيفة اللي فوق + رجاءاً عند طرح كود استخدم محرر الاكواد وحدد اللغه البرمجية 

LUA

بحيث يسهل قراءة الكود لذلك استعمل الوظيفة اللي عطيتك فوق وشيل الشخصيات فيها ومثال الويكي واضح وسهل .

Link to comment

مشتغلش

    else
    zfljal6ery222 = false
    engineRestoreModel ( 13 )

4 minutes ago, momar5600 said:

مازبط وش حل


addEventHandler("onClientGUIClick",root,function()if source == GUIEditor.button[2] then 
	engineRestoreModel ( 13 )
end -- نهاية 
end -- ..
) -- اقفال الحدث

 

 

Link to comment

انا عندي شخصيات كلها txt بدي اخلي لوحة

فيها زرين لما يضغط زر االاول كل شخصيات تشتغل عنده هو بس 

زر تاني يرجع للشخصايات الاصلية بس كمان عن شخص الي ضغط علي زر هو بس

يعني لما يغط علي زر ما يضفي كل شخصيات عند كل ناسس

فا ايش مشكلة هنا

addEventHandler("onClientGUIClick",root,
function()
if source == GUIEditor.button[2] then 
	skin = engineLoadTXD ( "skins/97.txd" )
	engineRestoreModel ( skin, 97 )
end -- نهاية 
end -- ..
) -- اقفال الحدث

 

Link to comment

سهل !

  skin = 287,285,281,280,277,247,124,107,106,105,102, 46,28,13

function x()
for i =  0  ,skin do

txd = engineLoadTXD("SKins/"..i..".txd")
engineImportTXD(txd, i)

downloadFile("SKins/"..i..".txd")
end
    end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), x)
    setTimer (x, 1000, 1) 
     addEventHandler("onClientGUIClick",root,function()if source == GUIEditor.button[2] then
    engineRestoreModel ( 13 )
    end -- نهاية
    end -- ..
    ) -- اقفال الحدث

 

Edited by medo7
Link to comment
2 minutes ago, medo7 said:

سهل !


  skin = 287,285,281,280,277,247,124,107,106,105,102, 46,28,15function x()for i =  0  ,skin do

txd = engineLoadTXD("SKins/"..i..".txd")
engineImportTXD(txd, i)

downloadFile("SKins/"..i..".txd")
end
    end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), x)
    setTimer (x, 1000, 1) 

     addEventHandler("onClientGUIClick",root,function()if source == GUIEditor.button[2] then    engineRestoreModel ( 13 )    end -- نهاية    end -- ..
    ) -- اقفال الحدث

 

انا مش فاهم شي

مفروض لما اضغط زي 

GUIEditor.button[2]

يضفي شخصية لية مش  حاطت زر

Link to comment

اتفضل

--SKIN REPLACEMENTS


GUIEditor = {
    button = {},
    window = {}
}

        GUIEditor.window[1] = guiCreateWindow(294, 190, 224, 213, "", false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(26, 78, 170, 40, "تشغيل شخصيات زومبي", false, GUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(26, 147, 170, 40, "اضفاء شخصيات زومبي", false, GUIEditor.window[1])    
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
bindKey("m", "down", 
function ()
      guiSetVisible(GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1])) 
      showCursor(guiGetVisible(GUIEditor.window[1]))
end
)

addEventHandler("onClientGUIClick",root,
function()
if source == GUIEditor.button[1] then 
	skin = engineLoadTXD ( "skins/13.txd" ) --bleedin eyes 31 by Slothman
	engineImportTXD ( skin, 13 )
	skin1 = engineLoadTXD ( "skins/22.txd" ) -- slashed 12 by Wall-E
	engineImportTXD ( skin1, 22 )	
	skin2 = engineLoadTXD ( "skins/56.txd" ) --young and blue by Slothman
	engineImportTXD ( skin2, 56 )
    skin3 = engineLoadTXD ( "skins/67.txd" ) -- slit r* employee
	engineImportTXD ( skin3, 67 )
    skin4 = engineLoadTXD ( "skins/68.txd" ) -- shredded preist by Deixell
	engineImportTXD ( skin4, 68 )
	skin5 = engineLoadTXD ( "skins/69.txd" ) --bleedin eyes in denim by Capitanazop
	engineImportTXD ( skin5, 69 )
	skin6 = engineLoadTXD ( "skins/70.txd" ) --ultra gory scientist by 50p
	engineImportTXD ( skin6, 70 )
	skin7 = engineLoadTXD ( "skins/84.txd" ) --guitar wolf (nonzombie) by Slothman
	engineImportTXD ( skin7, 84 )
	skin8 = engineLoadTXD ( "skins/92.txd" ) -- peeled flesh by xbost
	engineImportTXD ( skin8, 92 )
	skin9 = engineLoadTXD ( "skins/97.txd" ) -- easterboy by Slothman
	engineImportTXD ( skin9, 97 )
	skin11 = engineLoadTXD ( "skins/105.txd" ) --Scarred Grove Gangster by Wall-E
	engineImportTXD ( skin11, 105 )
	skin12 = engineLoadTXD ( "skins/107.txd" ) --ripped and slashed grove by Wall-E
	engineImportTXD ( skin12, 107 )
	skin13 = engineLoadTXD ( "skins/108.txd" ) -- skeleton thug by Deixell
	engineImportTXD ( skin13, 108 )
	skin14 = engineLoadTXD ( "skins/111.txd" ) --Frank West from dead rising (nonzombie) by Slothman
	engineImportTXD ( skin14, 111 )
	skin15 = engineLoadTXD ( "skins/126.txd" ) -- bullet ridden wiseguy by Slothman
	engineImportTXD ( skin15, 126 )
	skin16 = engineLoadTXD ( "skins/127.txd" ) --flyboy from dawn of the dead by Slothman
	engineImportTXD ( skin16, 127 )
	skin17 = engineLoadTXD ( "skins/128.txd" ) --holy native by Slothman
	engineImportTXD ( skin17, 128 )
	skin18 = engineLoadTXD ( "skins/152.txd" ) --bitten schoolgirl by Slothman
	engineImportTXD ( skin18, 152 )
	skin19 = engineLoadTXD ( "skins/162.txd" ) --shirtless redneck by Slothman
	engineImportTXD ( skin19, 162 )
	skin20 = engineLoadTXD ( "skins/167.txd" ) --dead chickenman by 50p
	engineImportTXD ( skin20, 167 )
	skin21 = engineLoadTXD ( "skins/188.txd" ) --burnt greenshirt by Slothman
	engineImportTXD ( skin21, 188 )
	skin22 = engineLoadTXD ( "skins/192.txd" ) --Alice from resident evil (nonzombie) by Slothman
	engineImportTXD ( skin22, 192 )
	skin23 = engineLoadTXD ( "skins/195.txd" ) --bloody ex by Slothman
	engineImportTXD ( skin23, 195 )
	skin24 = engineLoadTXD ( "skins/206.txd" ) -- faceless zombie by Slothman
	engineImportTXD ( skin24, 206 )
	skin25 = engineLoadTXD ( "skins/209.txd" ) --Noodle vendor by 50p
	engineImportTXD ( skin25, 209 )
	skin26 = engineLoadTXD ( "skins/212.txd" ) --brainy hobo by Slothman
	engineImportTXD ( skin26, 212 )
	skin27 = engineLoadTXD ( "skins/229.txd" ) --infected tourist by Slothman
	engineImportTXD ( skin27, 229 )
	skin28 = engineLoadTXD ( "skins/230.txd" ) --will work for brains hobo by Slothman
	engineImportTXD ( skin28, 230 )
	skin29 = engineLoadTXD ( "skins/258.txd" ) --bloody sided suburbanite by Slothman
	engineImportTXD ( skin29, 258 )
	skin30 = engineLoadTXD ( "skins/264.txd" ) --scary clown by 50p
	engineImportTXD ( skin30, 264 )
	skin31 = engineLoadTXD ( "skins/274.txd" ) --Ash Williams (nonzombie) by Slothman
	engineImportTXD ( skin31, 274 )
	skin32 = engineLoadTXD ( "skins/277.txd" ) -- gutted firefighter by Wall-E
	engineImportTXD ( skin32, 277 )
	skin33 = engineLoadTXD ( "skins/280.txd" ) --infected cop by Lordy
	engineImportTXD ( skin33, 280 )
	skin34 = engineLoadTXD ( "skins/287.txd" ) --torn army by Deixell
	engineImportTXD ( skin34, 287 )
end -- نهاية 
end -- ..
) -- اقفال الحدث

addEventHandler("onClientGUIClick",root,function()if source == GUIEditor.button[2] then
destroyElement ( skin )
end -- نهاية
end -- ..
) -- اقفال الحدث

 

Link to comment

اخوي استبدل هاذي 


GUIEditor = {
    button = {},
    window = {}
}

        GUIEditor.window[1] = guiCreateWindow(294, 190, 224, 213, "", false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(26, 78, 170, 40, "تشغيل شخصيات زومبي", false, GUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(26, 147, 170, 40, "اضفاء شخصيات زومبي", false, GUIEditor.window[1])    
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
bindKey("m", "down", 
function ()
      guiSetVisible(GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1])) 
      showCursor(guiGetVisible(GUIEditor.window[1]))
end
)

 

 

بهاذا

 

 

 

    wnd = guiCreateWindow(294, 190, 224, 213, "", false)
        guiWindowSetSizable(wnd, false)

        btn1 = guiCreateButton(26, 78, 170, 40, "تشغيل شخصيات زومبي", false, wnd)
        btn2 = guiCreateButton(26, 147, 170, 40, "اضفاء شخصيات زومبي", false, wnd)    
guiSetVisible(wnd, false)
function master ()
      guiSetVisible(wnd, not guiGetVisible (wnd)) 
      showCursor(guiGetVisible(wnd))
end

bindKey("m", "down", master)

 

Link to comment
1 minute ago, Master_MTA said:

اخوي استبدل هاذي 


GUIEditor = {
    button = {},
    window = {}
}

        GUIEditor.window[1] = guiCreateWindow(294, 190, 224, 213, "", false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(26, 78, 170, 40, "تشغيل شخصيات زومبي", false, GUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(26, 147, 170, 40, "اضفاء شخصيات زومبي", false, GUIEditor.window[1])    
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
bindKey("m", "down", 
function ()
      guiSetVisible(GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1])) 
      showCursor(guiGetVisible(GUIEditor.window[1]))
end
)

 

 

بهاذا

 

 

 


    wnd = guiCreateWindow(294, 190, 224, 213, "", false)
        guiWindowSetSizable(wnd, false)

        btn1 = guiCreateButton(26, 78, 170, 40, "تشغيل شخصيات زومبي", false, wnd)
        btn2 = guiCreateButton(26, 147, 170, 40, "اضفاء شخصيات زومبي", false, wnd)    
guiSetVisible(wnd, false)
function master ()
      guiSetVisible(wnd, not guiGetVisible (wnd)) 
      showCursor(guiGetVisible(wnd))
end

bindKey("m", "down", master)

 

يسلام  وش دخل ده بالي انا طالبة +++++راجع معلوماتك

Link to comment

خلاص
 

    skinTable = {
    15,55,56,67,
    }
     addEventHandler("onClientGUIClick",root,
    function()
    if (source == GUIEditor.button[1]) then

    for k,v in pairs(skinTable)do
    skin = engineLoadTXD ( "skins/"..v..".txd" ) 
    engineImportTXD ( skin, v ) 
    end
    elseif (source == GUIEditor.button[2]) then
    for k,v in pairs(skinTable)do
    skin = engineLoadTXD ( "skins/"..v..".txd" ) 
    destroyElement ( skin )
    engineRestoreModel (v)
    end
    end
    end)

 

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