Jump to content

طلب كودين


Recommended Posts

السلام عليكم

ممكن كود يخلي اللوحه الي سويتها تفتح بزر معين مع مثال

وايضا لما تفتح اللوحه يظهر الماوس ولما تقفل تروح الماوس مع مثال سهل :)

ويضا كود يعطي الاعب دم

وكود يعطي الاعب درع فقط لا غير ومشكورين

Edited by Guest
Link to comment
  • Replies 62
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

كود اللوحة

-- key = الزر  
-- wnd = اللوحة اللي تبيها تفتح 
  bindKey("key",'down', function (   ) 
    guiSetVisible ( wnd,not guiGetVisible ( wnd ) ) 
    showCursor ( guiGetVisible ( wnd ) ) 
    end ) 
  

كود الدم

setElementHealth 

كود الدرع

setPedArmor 

Link to comment

تابل معلش اسئلتي هي فقط

بدي تشوف الكود صح ولا لا الزر الي يخلي اللوحه تفتح بزر معين

وبدي كود يغلق اللوحه يعني لما يكبس المربع تغلق

واذا الاعب كبس زر يعطيه دم حسب الي انا اختاره

وايضا درع

ويا ريت تساعدني ادري طلبات كثيره بس محتاجهم

Link to comment
GUIEditor.window[1]

bindKey("F2",'down', function ( )

guiSetVisible ( wnd,not guiGetVisible ( wnd ) )

showCursor ( GUIEditor.window[1] ( wnd ) )

end )

كذا تصير؟

لا غلط تصير كذا

      bindKey("f2",'down', function (   ) 
      guiSetVisible ( GUIEditor.window[1],not guiGetVisible ( GUIEditor.window[1] )) 
      showCursor ( guiGetVisible ( GUIEditor.window[1])) 
    end ) 

بالنسبة للكود حق الدم والدرع اذا ضغطت على زر يحط دمك 100

وزر ثاني يحط درعك 100

Client :

addEventHandler ("onClientGUIClick",resourceRoot,  
function ()  
if ( source == اسم الزر حق الدرع) then 
triggerServerEvent ( "setarmor", localPlayer) 
elseif ( source == اسم الزر حق الدم) then 
triggerServerEvent ( "setahealth",localPlayer)  
end 
end 
) 

Server:

    addEvent("setahealth",true)  
    addEventHandler("setahealth",root, 
    function() 
    setElementHealth ( source,  100 ) 
    end) 
      
    addEvent("setarmor",true) 
    addEventHandler("setarmor",root, 
    function( ) 
    setPedArmor ( source, 100 ) 
    end) 
      

S

Link to comment

الكلنت

GUIEditor = {

button = {},

window = {}

}

addEventHandler("onClientResourceStart", resourceRoot,

function()

GUIEditor.window[1] = guiCreateWindow(351, 185, 638, 473, "لوحة التحكم", false)

guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.button[1] = guiCreateButton(38, 40, 162, 82, "تشغيل طيران السيارة", false, GUIEditor.window[1])

GUIEditor.button[2] = guiCreateButton(38, 351, 162, 82, "ايقاف المشي على البحر", false, GUIEditor.window[1])

GUIEditor.button[3] = guiCreateButton(38, 245, 162, 82, "المشي على البحر", false, GUIEditor.window[1])

GUIEditor.button[4] = guiCreateButton(38, 141, 162, 82, "ايقاف طيران السيارة", false, GUIEditor.window[1])

GUIEditor.button[5] = guiCreateButton(223, 141, 162, 82, "اعطاء درع", false, GUIEditor.window[1])

GUIEditor.button[6] = guiCreateButton(223, 40, 162, 82, "اعطاء دم", false, GUIEditor.window[1])

GUIEditor.button[7] = guiCreateButton(543, 421, 85, 42, "أغلاق", false, GUIEditor.window[1])

end

)

addEventHandler ("onClientGUIClick",resourceRoot, function ( )

if ( source == GUIEditor.button[1] ) then

setWorldSpecialPropertyEnabled ( "aircars", true )

end

end

)

addEventHandler ("onClientGUIClick",resourceRoot, function ( )

if ( source == GUIEditor.button[4] ) then

setWorldSpecialPropertyEnabled ( "aircars", false )

end

end

)

addEventHandler ("onClientGUIClick",resourceRoot, function ( )

if ( source == GUIEditor.button[3] ) then

setWorldSpecialPropertyEnabled ( "hovercars", true )

end

end

)

addEventHandler ("onClientGUIClick",resourceRoot, function ( )

if ( source == GUIEditor.button[2] ) then

setWorldSpecialPropertyEnabled ( "hovercars", false )

end

end

)

addEventHandler ( "onClientGUIClick", root,

function ( )

if source == GUIEditor.button[7] then

guiSetVisible (wnd,false)

showCursor (false)

end

end

)

addEventHandler ("onClientGUIClick",resourceRoot,

function ()

if ( source == GUIEditor.button[5]) then

triggerServerEvent ( "setarmor", localPlayer)

elseif ( source == GUIEditor.button[6]) then

triggerServerEvent ( "setahealth",localPlayer)

end

end

)

bindKey("f2",'down', function ( )

guiSetVisible ( GUIEditor.window[1],not guiGetVisible ( GUIEditor.window[1] ))

showCursor ( guiGetVisible ( GUIEditor.window[1]))

end )

السيرفر

addEvent("setahealth",true)

addEventHandler("setahealth",root,

function()

setElementHealth ( source, 100 )

end)

addEvent("setarmor",true)

addEventHandler("setarmor",root,

function( )

setPedArmor ( source, 100 )

end)

وش الخطأ انه ما يعطي دم وردع

Link to comment

وبالنسبه لزر اغلاق ما في له وظيفه لما اكبسه تسكر اللوحه؟؟

+اخر سؤال بأذن الله لما اشغل المود على طول تيجي اللوحه ما في طريقه تخلص المود يشتغل لكن ما يبين الا عند ظغط الزر

Link to comment

Client :

  
GUIEditor = { 
button = {}, 
window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
GUIEditor.window[1] = guiCreateWindow(351, 185, 638, 473, "لوحة التحكم", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetVisible ( GUIEditor.window[1], false) 
  
GUIEditor.button[1] = guiCreateButton(38, 40, 162, 82, "تشغيل طيران السيارة", false, GUIEditor.window[1]) 
GUIEditor.button[2] = guiCreateButton(38, 351, 162, 82, "ايقاف المشي على البحر", false, GUIEditor.window[1]) 
GUIEditor.button[3] = guiCreateButton(38, 245, 162, 82, "المشي على البحر", false, GUIEditor.window[1]) 
GUIEditor.button[4] = guiCreateButton(38, 141, 162, 82, "ايقاف طيران السيارة", false, GUIEditor.window[1]) 
GUIEditor.button[5] = guiCreateButton(223, 141, 162, 82, "اعطاء درع", false, GUIEditor.window[1]) 
GUIEditor.button[6] = guiCreateButton(223, 40, 162, 82, "اعطاء دم", false, GUIEditor.window[1]) 
GUIEditor.button[7] = guiCreateButton(543, 421, 85, 42, "أغلاق", false, GUIEditor.window[1]) 
end 
) 
  
bindKey("f2",'down', function (   ) 
guiSetVisible ( GUIEditor.window[1],not guiGetVisible ( GUIEditor.window[1])) 
showCursor ( guiGetVisible ( GUIEditor.window[1])) 
end ) 
  
  
addEventHandler ("onClientGUIClick",resourceRoot, function ( ) 
if ( source == GUIEditor.button[1] ) then 
setWorldSpecialPropertyEnabled ( "aircars", true ) 
end 
end 
) 
  
addEventHandler ("onClientGUIClick",resourceRoot, function ( ) 
if ( source == GUIEditor.button[4] ) then 
setWorldSpecialPropertyEnabled ( "aircars", false ) 
end 
end 
) 
  
addEventHandler ("onClientGUIClick",resourceRoot, function ( ) 
if ( source == GUIEditor.button[3] ) then 
setWorldSpecialPropertyEnabled ( "hovercars", true ) 
end 
end 
) 
  
addEventHandler ("onClientGUIClick",resourceRoot, function ( ) 
if ( source == GUIEditor.button[2] ) then 
setWorldSpecialPropertyEnabled ( "hovercars", false ) 
end 
end 
) 
  
addEventHandler ( "onClientGUIClick", root, 
function ( ) 
if source == GUIEditor.button[7] then 
guiSetVisible (wnd,false) 
showCursor (false) 
end 
end 
) 
  
addEventHandler ("onClientGUIClick",resourceRoot, 
function () 
if ( source == GUIEditor.button[5]) then 
triggerServerEvent ( "setarmor", localPlayer) 
elseif ( source == GUIEditor.button[6]  ) then 
triggerServerEvent ( "setahealth",localPlayer) 
end 
end 
) 

Server :

addEvent("setahealth",true) 
addEventHandler("setahealth",root, 
function() 
setElementHealth ( source, 100 ) 
end) 
  
addEvent("setarmor",true) 
addEventHandler("setarmor",root, 
function( ) 
setPedArmor ( source, 100 ) 
end) 

Edited by Guest
Link to comment

GUIEditor = { 
    button = {}, 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
    GUIEditor.window[1] = guiCreateWindow(351, 185, 638, 473, "لوحة التحكم", false) 
    guiWindowSetSizable(GUIEditor.window[1], false) 
    guiSetVisible(GUIEditor.window[1],false) 
    GUIEditor.button[1] = guiCreateButton(38, 40, 162, 82, "تشغيل طيران السيارة", false, GUIEditor.window[1]) 
    GUIEditor.button[2] = guiCreateButton(38, 351, 162, 82, "ايقاف المشي على البحر", false, GUIEditor.window[1]) 
    GUIEditor.button[3] = guiCreateButton(38, 245, 162, 82, "المشي على البحر", false, GUIEditor.window[1]) 
    GUIEditor.button[4] = guiCreateButton(38, 141, 162, 82, "ايقاف طيران السيارة", false, GUIEditor.window[1]) 
    GUIEditor.button[5] = guiCreateButton(223, 141, 162, 82, "اعطاء درع", false, GUIEditor.window[1]) 
    GUIEditor.button[6] = guiCreateButton(223, 40, 162, 82, "اعطاء دم", false, GUIEditor.window[1]) 
    GUIEditor.button[7] = guiCreateButton(543, 421, 85, 42, "أغلاق", false, GUIEditor.window[1]) 
end 
) 
  
addEventHandler ("onClientGUIClick",guiRoot, function ( ) 
    if ( source == GUIEditor.button[1] ) then 
        setWorldSpecialPropertyEnabled ( "aircars", true ) 
    elseif ( source == GUIEditor.button[4] ) then 
        setWorldSpecialPropertyEnabled ( "aircars", false ) 
    elseif ( source == GUIEditor.button[3] ) then 
        setWorldSpecialPropertyEnabled ( "hovercars", true ) 
    elseif ( source == GUIEditor.button[2] ) then 
        setWorldSpecialPropertyEnabled ( "hovercars", false ) 
    elseif ( source == GUIEditor.button[7] ) then 
        guiSetVisible (GUIEditor.window[1],false) 
        showCursor (false) 
    elseif ( source == GUIEditor.button[5] ) then 
        triggerServerEvent ( "setarmor", localPlayer) 
    elseif ( source == GUIEditor.button[6] ) then 
        triggerServerEvent ( "setahealth",localPlayer) 
    end 
end 
) 
  
  
  
bindKey("f2",'down', function ( ) 
    guiSetVisible ( GUIEditor.window[1],not guiGetVisible ( GUIEditor.window[1] )) 
    showCursor ( guiGetVisible ( GUIEditor.window[1])) 
end ) 
  

addEvent("setahealth",true) 
addEventHandler("setahealth",root, 
function() 
setElementHealth ( source, 100 ) 
end) 
  
addEvent("setarmor",true) 
addEventHandler("setarmor",root, 
function( ) 
setPedArmor ( source, 100 ) 
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...