Master_MTA Posted June 30, 2016 Share Posted June 30, 2016 (edited) السلام عليكم اخواني اليوم حبيت استفسر عن شي جنني والله ومدري وش الغلط فيه الحين انا مسوي بانل تفتح لما يضغط الماوس على المنت ومسوي تحقق للاالمنت ووهذي محاولاتي كلها فشلت وقلت اكيد بتفيدوني كلها سيرفر سايد كلننت سايد مافي اي مشكله function elementClicked( Target ) if getElementType (Target) == "player" then triggerClientEvent(client,"openGui",client) else outputChatBox("you are not police or admin",source,255,255,255) end end addEvent("check2",true) addEventHandler("check2",root, function() local acc=getPlayerAccount(client) if(isObjectInACLGroup("user."..getAccountName(acc),aclGetGroup("Police"))) then addEventHandler( "onElementClicked", getRootElement(), elementClicked ) else outputChatBox("you are not police or admin",source,255,255,255) end end ) Edited June 30, 2016 by Guest Link to comment
YourMind Posted June 30, 2016 Share Posted June 30, 2016 function elementClicked(_,_,plr) if getElementType (source) == "player" then triggerClientEvent(plr,"openGui",plr) removeElementData (plr,"bugfix") removeEventHandler ("onElementClicked",plr,elementClicked) end end addEvent("check2",true) addEventHandler("check2",root, function() local acc = getPlayerAccount(source) if isObjectInACLGroup("user."..getAccountName(acc),aclGetGroup("Police")) then if not getElementData (source,"bugfix") then addEventHandler("onElementClicked",source,elementClicked) setElementData (source,"bugfix",true) else outputChatBox ("The event is already handled",source,255,5,5) end else outputChatBox("You are not police or admin",source,255,255,255) end end ) Link to comment
' A F . Posted June 30, 2016 Share Posted June 30, 2016 Group = "Console" addEventHandler("onElementClicked",root, function ( Button , State , Player ) if ( Button == "left" and State == "down" ) then if ( getElementType ( source ) == "player" ) then if ( not isGuestAccount ( getPlayerAccount ( Player ) ) ) then if ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount(Player)),aclGetGroup(Group)) ) then outputChatBox("# Clicked : "..getPlayerName(source),Player,0,255,0,true) else outputChatBox("* you are not police or admin ",Player,255,0,0,true) end else outputChatBox("* please login",Player,255,0,0,true) end end end end ) بدل الكونسل للقروب الي تبيه يقدر يظغط على الاعبين Link to comment
Master_MTA Posted June 30, 2016 Author Share Posted June 30, 2016 اسف اخوي زبط نسيت اضيف المود لجروب ادمن فقط مشكور Link to comment
Master_MTA Posted June 30, 2016 Author Share Posted June 30, 2016 معليش اخوي لو مثلا ابي اسوي طرد في ايفينت غير هذا اخوي بس للاعب اللي ضغطت عليه Link to comment
' A F . Posted June 30, 2016 Share Posted June 30, 2016 معليش اخوي لو مثلا ابي اسوي طرد في ايفينت غير هذا اخوي بس للاعب اللي ضغطت عليه وضح شوي . Link to comment
YourMind Posted June 30, 2016 Share Posted June 30, 2016 قصده لما ييجي يدوس علي اي لاعب بالماوس يطرده addEventHandler ("onElementClicked",root, function (_,_,plr) if getElementType(source) == "player" then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("Police")) then kickPlayer (source,plr) end end end) Link to comment
Master_MTA Posted June 30, 2016 Author Share Posted June 30, 2016 قصدي لما اضغط على اللاعب تفتحلي لوحه اللوحه بها زر يطرد اللاعب انا قصدي يكون اللاعب المطرود هو هذا واسف والله اتعبتكم ادري بتحتاج تراقر وشغل بس اسف Link to comment
' A F . Posted June 30, 2016 Share Posted June 30, 2016 سوي ترآيقر triggerClientEvent Link to comment
Master_MTA Posted June 30, 2016 Author Share Posted June 30, 2016 يب اخوي انا قصدي كيف اربط اللاعب المضغوط عليه بالتراقر ادري اني بسوي تراقر ومقدر مساعدتك اسف اتعبتك هذا كان سؤالي من الاساس Link to comment
' A F . Posted June 30, 2016 Share Posted June 30, 2016 (edited) Client Side : addEvent("OpenWindow",true) addEventHandler("OpenWindow",root, function ( WasClicked ) outputChatBox(getPlayerName(WasClicked).." Ping : "..getPlayerPing(WasClicked)) end) Server Side : Group = "Console" addEventHandler("onElementClicked",root, function ( Button , State , Player ) if ( Button == "left" and State == "down" ) then if ( getElementType ( source ) == "player" ) then if ( Player == source ) then return outputChatBox("* لايمكنك الظغط على نفسك",Player,255,0,0,true) end if ( not isGuestAccount ( getPlayerAccount ( Player ) ) ) then if ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount(Player)),aclGetGroup(Group)) ) then triggerClientEvent ( Player , "OpenWindow" , Player , source ) else outputChatBox("* you are not police or admin ",Player,255,0,0,true) end else outputChatBox("* please login",Player,255,0,0,true) end end end end ) طبعأ هاذا مثأل لو ظغطت على اللاعب يطلع لك بنقه واسمه Edited June 30, 2016 by Guest Link to comment
فاّرس Posted June 30, 2016 Share Posted June 30, 2016 ^ لو تتحقق ان اللاعب ماضغط على نفسه مو يكون احسن؟ لأن ما اتوقع يبغى يضغط على نفسه وتطلع اللوحه. Link to comment
' A F . Posted June 30, 2016 Share Posted June 30, 2016 ^ لو تتحقق ان اللاعب ماضغط على نفسه مو يكون احسن؟ لأن ما اتوقع يبغى يضغط على نفسه وتطلع اللوحه. تم عدلت الكود , انا ماكنت حاطها عشان كنت اجرب ع نفسي . Link to comment
Master_MTA Posted June 30, 2016 Author Share Posted June 30, 2016 يب ادري وجالس اجرب على نفسي الاول بس ومشكور جالس اشوف بيزبط ولا لا Link to comment
Master_MTA Posted June 30, 2016 Author Share Posted June 30, 2016 اخوي هل كذا صح ولا كذا اجيب نفسي مو لاعب ثاني سيرفر سايد function elementClicked(_,_,plr) local mhaster12 = getPlayerName (source) if getElementType (source) == "player" then triggerClientEvent(plr,"openGui",plr) triggerClientEvent(plr,"openGui123",plr,mhaster12) removeElementData (plr,"bugfix") removeEventHandler ("onElementClicked",plr,elementClicked) end end كلنت function strongmaster ( mhaster12 ) guiSetText(wnd,mhaster12) end addEvent( "openGui123", true ) addEventHandler( "openGui123",root,strongmaster) Link to comment
Master_MTA Posted June 30, 2016 Author Share Posted June 30, 2016 اخوي هل كذا صح ولا كذا اجيب نفسي مو لاعب ثاني سيرفر سايد function elementClicked(_,_,plr) local mhaster12 = getPlayerName (source) if getElementType (source) == "player" then triggerClientEvent(plr,"openGui",plr) triggerClientEvent(plr,"openGui123",plr,mhaster12) removeElementData (plr,"bugfix") removeEventHandler ("onElementClicked",plr,elementClicked) end end كلنت function strongmaster ( mhaster12 ) guiSetText(wnd,mhaster12) end addEvent( "openGui123", true ) addEventHandler( "openGui123",root,strongmaster) Link to comment
' A F . Posted June 30, 2016 Share Posted June 30, 2016 addEventHandler("onElementClicked",root, function ( _ , _ , Player ) if ( getElementType ( Player ) == "player" ) then -- if ( Player == source ) then return outputChatBox("* لايمكنك الظغط على نفسك",Player,255,0,0,true) end triggerClientEvent ( Player , "openGui" , Player ) triggerClientEvent(Player,"openGui123",Player,getPlayerName(source)) end end) -- Client addEvent("openGui123",true) addEventHandler("openGui123",root, function ( Name ) guiSetText ( wnd , tostring ( Name ) ) end) Link to comment
Master_MTA Posted June 30, 2016 Author Share Posted June 30, 2016 اخوي معليش شي اخير بطلبو وش الخطا في هذا الكود كلنت addEventHandler("onClientGUIClick", getRootElement(), root, function () local ali19 = guiGetText(wnd) if source == sabab1 then if Slap then guiSetVisible(sabab, false) masterali123 = guiGetText(editsabab) triggerServerEvent ( "SlapP", getLocalPlayer(), tostring(Slap),masterali123 ,ali19) end end end ) سيرفر function Slap ( masterali123,ali19 ) local theTarget = getPlayerName (ali19) local thePlayer = ( source ) local account = getPlayerAccount(theTarget) local accname = getAccountName(account) local isConsole = isObjectInACLGroup("user."..accname,aclGetGroup("Console")) setElementHealth ( theTarget, 0 ) outputChatBox (" #B611CF* " .. getPlayerName(theTarget) .. " #B611CF has been slapped by #B611CF " .. getPlayerName(thePlayer) .. "#B611CF (".. masterali123 ..")" , getRootElement() ,189,13,215, true) outputChatBox (" * [ Error ] Bad arguments" , thePlayer , 255, 0, 0) end addEvent("SlapP",true) addEventHandler( "SlapP", getRootElement(), Slap ) Link to comment
' A F . Posted June 30, 2016 Share Posted June 30, 2016 -- Client addEventHandler("onClientGUIClick",root, function ( ) if ( source == Button ) then if ( guiGetText ( wnd ) ~= "" and getPlayerFromName ( guiGetText ( wnd ) ) and guiGetText(editsabab) ~= "" ) then triggerServerEvent("onSlap",localPlayer,guiGetText(editsabab),guiGetText(wnd)) end end end) -- Server addEvent("onSlap",true) addEventHandler("onSlap",root, function ( Resaon , Player ) if ( getPlayerFromName ( Player ) ) then killPed ( getPlayerFromName ( Player ) ) outputChatBox (" #B611CF* " ..getPlayerName(getPlayerFromName(Player)).. " #B611CF has been slapped by #B611CF " ..getPlayerName(source).. "#B611CF ("..Resaon..")",root,189,13,215, true) end end ) Link to comment
Master_MTA Posted June 30, 2016 Author Share Posted June 30, 2016 والله ما ادري كيف اشكرك الله يطول في عمرك ويرزقك الجنه انت واحبابك مشكوور اخوي افدتني وزياده وانا اشوف 59 قليله عليك تستاهل ازيد 79 حرام والله مشكور من جد Link to comment
' A F . Posted June 30, 2016 Share Posted June 30, 2016 والله ما ادري كيف اشكرك الله يطول في عمرك ويرزقك الجنه انت واحبابك مشكوور اخوي افدتني وزياده وانا اشوف 59 قليله عليك تستاهل ازيد 79 حرام والله مشكور من جد تسسسلم حبيبي ع راسي والله <3 , آمين ويآك والمسلمين آجميعن <3 Link to comment
Master_MTA Posted June 30, 2016 Author Share Posted June 30, 2016 اخوي اسف اخر سؤال لو حبيت اضيف لو ضغط على السياره يطلع اسم اخر واحد كان راكب السياره في نفس الكود الاول يعني زي لوحة االشرطي بطاره ومعليييش على التعب Link to comment
Master_MTA Posted June 30, 2016 Author Share Posted June 30, 2016 function elementClicked(_,_,plr) local mhaster12 = getPlayerName (source) if getElementType (source) == "player" then triggerClientEvent(plr,"openGui",plr) triggerClientEvent(plr,"openGui123",plr,mhaster12) removeElementData (plr,"bugfix") removeEventHandler ("onElementClicked",plr,elementClicked) end end Link to comment
' A F . Posted June 30, 2016 Share Posted June 30, 2016 والله م اعرف لوحة الشرطي الي بطارة . . getPedOccupiedVehicle -- عشان تجيب سيارة الاعب getVehicleController -- عشان تجيب السواق 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