mody134 Posted November 16, 2016 Share Posted November 16, 2016 (edited) معاى كود قفل الوحة فى الديربي عايز اخلية يفتح الوحة لسريال محدد الكود buttons = { ['F1'] = true, ['F3'] = true, ['b'] = true, ['F4'] = true, ['F5'] = true, ['F6'] = true, ['F7'] = true, ['F9'] = true, ['p'] = true, ['h'] = true, } addEventHandler( 'onClientKey', root, function (button , prees) if prees and getElementDimension(localPlayer) == 30 then if buttons[button] then outputChatBox("غير مصرح لك بفتح اللوحة ", 255, 0, 0) cancelEvent() end end end) Edited November 16, 2016 by mody134 Link to comment
mody134 Posted November 16, 2016 Author Share Posted November 16, 2016 جربت ذا الكود وخربت الوحة Serial = { -- سريال الاعب المصرح لهم ["ضع سريالك هنا"] = true, --["ضع سريالك هنا"] = true, --["ضع سريالك هنا"] = true, --["ضع سريالك هنا"] = true, } local buttons = { -- لوحات الي تمنعها ['F1'] = true, ['p'] = true, ['['] = true, [']'] = true, } addEventHandler( 'onClientKey', root, function (button , press) if press and getElementDimension(localPlayer) == 30 or getElementDimension(localPlayer) == العالم الثاني then -- رقم العالم if buttons[button] then -- عند الضغط على الازرار local PlayerSerial = getPlayerSerial(localPlayer) --- يجيب سريال الاعب if ( Serial[PlayerSerial] ) then -- اذا كان سريال الاعب من ضمن الجدول outputChatBox(" تم فتح الوحة ", 255, 0, ) else --- العكس outputChatBox("غير مصرح لك بفتح اللوحة الان ", 255, 0, 0) cancelEvent() -- يكنسل الشي end end end end ) Link to comment
iPrestege Posted November 16, 2016 Share Posted November 16, 2016 buttons = { ['F1'] = true, ['F3'] = true, ['b'] = true, ['F4'] = true, ['F5'] = true, ['F6'] = true, ['F7'] = true, ['F9'] = true, ['p'] = true, ['h'] = true, } addEventHandler( 'onClientKey',root, function ( button,prees ) if prees and getElementDimension ( localPlayer ) == 30 then if buttons [ button ] then if getPlayerSerial () == 'Your Serial Here' then return end outputChatBox ( 'غير مصرح لك بفتح اللوحة',255,0,0 ) cancelEvent ( ) end end end ) Link to comment
mody134 Posted November 16, 2016 Author Share Posted November 16, 2016 حطت السريال ولسة الوحة مقفولة buttons = { ['F1'] = true, ['F3'] = true, ['b'] = true, ['F4'] = true, ['F5'] = true, ['F6'] = true, ['F7'] = true, ['F9'] = true, ['p'] = true, ['h'] = true, } addEventHandler( 'onClientKey',root, function ( button,prees ) if prees and getElementDimension ( localPlayer ) == 30 then if buttons [ button ] then if getPlayerSerial () == '28251FCA0FFFFBEC7F5F8FC619B14902' then return end outputChatBox ( 'غير مصرح لك بفتح اللوحة',255,0,0 ) cancelEvent ( ) end end end ) Link to comment
AHMED MOSTAFA Posted November 16, 2016 Share Posted November 16, 2016 حطت السريال ولسة الوحة مقفولة buttons = { ['F1'] = true, ['F3'] = true, ['b'] = true, ['F4'] = true, ['F5'] = true, ['F6'] = true, ['F7'] = true, ['F9'] = true, ['p'] = true, ['h'] = true, } addEventHandler( 'onClientKey',root, function ( button,prees ) if prees and getElementDimension ( localPlayer ) == 30 then if buttons [ button ] then if getPlayerSerial () == '28251FCA0FFFFBEC7F5F8FC619B14902' then return end outputChatBox ( 'غير مصرح لك بفتح اللوحة',255,0,0 ) cancelEvent ( ) end end end ) getPlayerSerial cancelEvent () Link to comment
iPrestege Posted November 16, 2016 Share Posted November 16, 2016 اعتذر منك أخوي حصل تغيير في وظيفة سريال الاعب لذلك تقدر تسوي كذا بالسيرفر سايد : -- Server Side !!!!! addEventHandler ( 'onResourceStart',resourceRoot, function ( ) for _,aPlayer in next,getElementsByType ( 'player' ) do if getPlayerSerial ( aPlayer ) then setElementData ( aPlayer,'aPlayerSerial',getPlayerSerial ( aPlayer ) ) end end end ) addEventHandler ( 'onPlayerJoin',root, function ( ) if getPlayerSerial ( source ) then setElementData ( source,'aPlayerSerial',getPlayerSerial ( source ) ) end end ) وبالكلنت كذا : buttons = { ['F1'] = true, ['F3'] = true, ['b'] = true, ['F4'] = true, ['F5'] = true, ['F6'] = true, ['F7'] = true, ['F9'] = true, ['p'] = true, ['h'] = true, } addEventHandler( 'onClientKey',root, function ( button,prees ) if prees and getElementDimension ( localPlayer ) == 30 then if buttons [ button ] then if getElementData ( localPlayer,'aPlayerSerial' ) == 'Your Serial Here' then return end outputChatBox ( 'غير مصرح لك بفتح اللوحة',255,0,0 ) cancelEvent ( ) end end end ) جرب ورد لي خبر Link to comment
mody134 Posted November 16, 2016 Author Share Posted November 16, 2016 السيرفر سايد الى هو ملف سيرفر Link to comment
AHMED MOSTAFA Posted November 16, 2016 Share Posted November 16, 2016 السيرفر سايد الى هو ملف سيرفر جرب هذا buttons = { ['F1'] = true, ['F3'] = true, ['b'] = true, ['F4'] = true, ['F5'] = true, ['F6'] = true, ['F7'] = true, ['F9'] = true, ['p'] = true, ['h'] = true, } addEventHandler( 'onClientKey',root, function ( Player, button, prees ) if not getPlayerSerial ( Player ) == '28251FCA0FFFFBEC7F5F8FC619B14902' then if prees and getElementDimension ( localPlayer ) == 30 then if buttons [ button ] then outputChatBox ( 'غير مصرح لك بفتح اللوحة',255,0,0 ) cancelEvent ( ) end end outputChatBox ( 'تم فتح اللوحة',0,255,0 ) end end ) ملاحظة انا ما جربته Link to comment
mody134 Posted November 16, 2016 Author Share Posted November 16, 2016 حطتة بملف كيلنت ولسة يطلعلى غير مصرح لك باستخدام الوحة Link to comment
AHMED MOSTAFA Posted November 16, 2016 Share Posted November 16, 2016 حطتة بملف كيلنت ولسة يطلعلى غير مصرح لك باستخدام الوحة triggerServerEvent triggerClientEvent Link to comment
iPrestege Posted November 16, 2016 Share Posted November 16, 2016 28 minutes ago, mody134 said: السيرفر سايد الى هو ملف سيرفر ايه نعم ملف سيرفر Link to comment
mody134 Posted November 16, 2016 Author Share Posted November 16, 2016 حطتة بملف سيرفر ولسة الوحة مشتغلتش Link to comment
AHMED MOSTAFA Posted November 16, 2016 Share Posted November 16, 2016 حطتة بملف سيرفر ولسة الوحة مشتغلتش تصميم ال gui ما يشتغل في ملف السيرفر وافينت onClientKey او اي افينت فيه كلمه Client ما يشتغل في ملف سيرفر اربط ملف سيرفر بملف الكلينت عن طريق الترايجر - triggerServerEvent triggerClientEvent Link to comment
iPrestege Posted November 16, 2016 Share Posted November 16, 2016 17 minutes ago, mody134 said: حطتة بملف سيرفر ولسة الوحة مشتغلتش ماهو كلة سيرفر الجزء الخاص بالضغط كلنت والجزء الخاص بالداتا سيرفر 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