w7sH Posted May 18, 2016 Share Posted May 18, 2016 السلام عليكم معي زر ابيه مثلا اذا ضغط الزر يكتب له كلمه في اف 8 مثلا الزر ( ذا) اذا ضغطه يشغل كوماند هذا الزر mywind[12] = guiCreateButton(439,24,42,29,"Kick",false,mywind[7]) mywind[14] = guiCreateButton(283,26,88,29,"-",false,mywind[7]) mywind[11] = guiCreateButton(376,25,58,29,"-",false,mywind[7]) mywind[8] = guiCreateButton(9,25,86,30,"-",false,mywind[7]) mywind[9] = guiCreateButton(103,25,86,30,"الزر المطلوب",false,mywind[7]) mywind[10] = guiCreateButton(193,27,86,28,"-",false,mywind[7]) Link to comment
w7sH Posted May 18, 2016 Author Share Posted May 18, 2016 addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == jail ) then executeCommandHandler("jail") end end) م ضبط ..؟ Link to comment
Adham Posted May 18, 2016 Share Posted May 18, 2016 شف كذا addEventHandler("onClientGUIClick",resourceRoot, function ( player ) if ( source == jail ) then executeCommandHandler("jail",player) end end) او addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == jail ) then executeCommandHandler("jail",localPlayer) end end) Link to comment
w7sH Posted May 18, 2016 Author Share Posted May 18, 2016 كودك م ضبط ^^^ بطرح كود سيرفر عشان تفهم كودي elseif source == mywind[4] then -- close close() elseif source == mywind[9] then -- freez selectedPlayerfreez = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if selectedPlayerfreez then triggerServerEvent ("Frozen", getLocalPlayer(), tostring(selectedPlayerfreez)) end elseif source == mywind[10] then -- unfreez selectedPlayerunfreez = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if selectedPlayerunfreez then triggerServerEvent ("unFrozen", getLocalPlayer(), tostring(selectedPlayerunfreez)) end elseif source == mywind[11] then -- slap selectedPlayerslap = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if selectedPlayerslap then triggerServerEvent ("slap", getLocalPlayer(), tostring(selectedPlayerslap)) end elseif source == mywind[14] then -- destroy destroy = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if destroy then triggerServerEvent ("destroy", getLocalPlayer(), destroy) end elseif source == mywind[12] then -- kick kick = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if kick then triggerServerEvent ("kickm", getLocalPlayer(), tostring(kick)) end elseif source == mywind[8] then -- jail nameplayerjail = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) jail = guiGridListGetItemText ( mywind[5], guiGridListGetSelectedItem ( mywind[5] ), 1 ) if jail and nameplayerjail then triggerServerEvent ("jail", getLocalPlayer(), nameplayerjail, jail) end elseif source == mywind[6] then -- unjail nameplayerunjail = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if nameplayerunjail then triggerServerEvent ("unjail", getLocalPlayer(), nameplayerunjail) end end end addEventHandler("onClientGUIClick",root,onClickza) Link to comment
Adham Posted May 18, 2016 Share Posted May 18, 2016 أعتقد ذا طلبك لو طلع طلبك صح كمل انت ^ addEventHandler("onClientGUIClick",resourceRoot, function () if ( source == mywind[11] ) then local se = guiGridListGetItemText ( mywind[11], guiGridListGetSelectedItem ( mywind[11] ), 1 ) if Se and Se ~= -1 then triggerServerEvent ("slap",localPlayer) end end ) Link to comment
#|_oskar_|# Posted May 18, 2016 Share Posted May 18, 2016 اذا كودك سيرفر مراح يضبط سوي ترايقر من كلنت لسيرفر Link to comment
#|_oskar_|# Posted May 18, 2016 Share Posted May 18, 2016 ^ triggerClientEvent triggerServerEvent Link to comment
w7sH Posted May 18, 2016 Author Share Posted May 18, 2016 اذا كودك سيرفر مراح يضبط سوي ترايقر من كلنت لسيرفر كودي كلنكت Link to comment
#|_oskar_|# Posted May 18, 2016 Share Posted May 18, 2016 اذا كودك سيرفر مراح يضبط سوي ترايقر من كلنت لسيرفر كودي كلنكت اقصد الامر اللى تكتبه ب اف 8 بجانب سيرفر ولا كلنت ؟ Link to comment
Adham Posted May 18, 2016 Share Posted May 18, 2016 addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == jail ) then executeCommandHandler("jail",source) end end) Link to comment
w7sH Posted May 18, 2016 Author Share Posted May 18, 2016 ^^ كودك م يشتغل لازم احول سيرفر , ننتظر اوسكار Link to comment
w7sH Posted May 18, 2016 Author Share Posted May 18, 2016 jail تفتح له لوحة ثانيه ب الكوماند jail ابي اخلي ااذا ضغطت على كلمة كود كلنكت كامل عشان تفهم --Key For Open Panel ------------------- local key = "m" ----------------- -- when start check Is there any admin ---------------- addEventHandler("onClientResourceStart",resourceRoot, function() triggerServerEvent("checkPermission",localPlayer) end ) ---------------- --panel for admin only ---------------- local mywind = {} g_Root = getRootElement() addEvent("onClient_admin",true) addEventHandler("onClient_admin",root, function () local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 191,455 local left = screenWidth/245 - windowWidth/100 local top = screenHeight/1.5 - windowHeight/1.5 for k,v in pairs(mywind) do if isElement(envy) then destroyElement(envy) end end mywind = {} mywind[1] = guiCreateStaticImage(left,top,windowWidth,windowHeight,"img/s1.png",false) guiSetAlpha(mywind[1],0.89999997615814) mywind[2] = guiCreateGridList(9,23,176,365,false,mywind[1]) guiGridListSetSelectionMode(mywind[2],0) local col = guiGridListAddColumn(mywind[2],"Player name",0.90) mywind[3] = guiCreateButton(17,401,82,37,"Spectate / مراقبة",false,mywind[1]) mywind[4] = guiCreateButton(105,401,77,36,"Close / إغلاق",false,mywind[1]) local screenWidthhh, screenHeighttt = guiGetScreenSize() local windowWidthhh, windowHeighttt = 497, 74 local lefttt = screenWidthhh/1 - windowWidthhh/1 local toppp = screenHeighttt/1 - windowHeighttt/1 mywind[7] = guiCreateStaticImage(lefttt,toppp,windowWidthhh,windowHeighttt,"img/s1.png",false) guiSetAlpha(mywind[7],0.89999997615814) mywind[12] = guiCreateButton(439,24,42,29,"Kick / طرد",false,mywind[7]) mywind[14] = guiCreateButton(283,26,88,29,"Destroy / سحب السيارة",false,mywind[7]) mywind[11] = guiCreateButton(376,25,58,29,"Slap / قتل",false,mywind[7]) mywind[8] = guiCreateButton(9,25,86,30,"Jail / سجن",false,mywind[7]) mywind[9] = guiCreateButton(103,25,86,30,"Freeze / تجميد",false,mywind[7]) mywind[10] = guiCreateButton(193,27,86,28,"un / فك التجميد",false,mywind[7]) local screenWidthh, screenHeightt = guiGetScreenSize() local windowWidthh, windowHeightt = 120, 164 local leftt = screenWidthh/3.5 - windowWidthh/3.5 local topp = screenHeightt/1 - windowHeightt/1 mywind[13] = guiCreateStaticImage(leftt,topp, windowWidthh,windowHeightt,"img/s1.png",false) guiSetAlpha(mywind[13],0.89999997615814) mywind[5] = guiCreateGridList(10,24,101,97,false,mywind[13]) guiGridListSetSelectionMode(mywind[5],2) local column = guiGridListAddColumn(mywind[5],"Jail Time",0.60) row1 = guiGridListAddRow(mywind[5]) row2 = guiGridListAddRow(mywind[5]) row3 = guiGridListAddRow(mywind[5]) row4 = guiGridListAddRow(mywind[5]) row5 = guiGridListAddRow(mywind[5]) row6 = guiGridListAddRow(mywind[5]) guiGridListSetItemText(mywind[5],row1,column,"1 min", false, false) guiGridListSetItemColor ( mywind[5], row1, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row2,column,"2 min", false, false) guiGridListSetItemColor ( mywind[5], row2, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row3,column,"3 min", false, false) guiGridListSetItemColor ( mywind[5], row3, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row4,column,"4 min", false, false) guiGridListSetItemColor ( mywind[5], row4, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row5,column,"5 min", false, false) guiGridListSetItemColor ( mywind[5], row5, column, 0, 0, 255 ) mywind[6] = guiCreateButton(9,129,102,24,"unJail / فك السجن",false,mywind[13]) for k,v in ipairs(mywind) do guiSetVisible(v,false) end end) --------------------- --Key to poen panel --------------------- open = false bindKey ( key, "down", function ( ) if open == false then add() for k,v in ipairs(mywind) do guiSetVisible(v,true) end showCursor(true) open = true else close() end end ) ----------------------- --add player to list ---------------------- function add() guiGridListClear(mywind[2]) for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( mywind[2] ) local name = getPlayerName(playeritem) guiGridListSetItemText ( mywind[2], row, 1, name, false, false ) guiGridListSetItemColor ( mywind[2], row, 1, 0, 250, 154, 255 ) end end --------------------- --close panel --------------------- function close() for k,v in ipairs(mywind) do guiSetVisible(v,false) end showCursor(false) open = false setCameraTarget ( getLocalPlayer() ) end ---------------------- -- Watch the player ---------------------- function spectatePlayer(player) if tostring(player) then int = getElementInterior(player) dim = getElementDimension(player) if int and dim then setCameraTarget(player) setElementInterior(player,int) setElementDimension(player,dim) end end end ---------------------- --When client click button --------------------- function onClickza() if source == mywind[3] then -- Spectate Player selectedPlayer = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if selectedPlayer then theselectedPlayer = getPlayerFromName(selectedPlayer) if theselectedPlayer then spectatePlayer(theselectedPlayer) end end elseif source == mywind[4] then -- close close() elseif source == mywind[9] then -- freez selectedPlayerfreez = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if selectedPlayerfreez then triggerServerEvent ("Frozen", getLocalPlayer(), tostring(selectedPlayerfreez)) end elseif source == mywind[10] then -- unfreez selectedPlayerunfreez = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if selectedPlayerunfreez then triggerServerEvent ("unFrozen", getLocalPlayer(), tostring(selectedPlayerunfreez)) end elseif source == mywind[11] then -- slap selectedPlayerslap = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if selectedPlayerslap then triggerServerEvent ("slap", getLocalPlayer(), tostring(selectedPlayerslap)) end elseif source == mywind[14] then -- destroy destroy = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if destroy then triggerServerEvent ("destroy", getLocalPlayer(), destroy) end elseif source == mywind[12] then -- kick kick = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if kick then triggerServerEvent ("kickm", getLocalPlayer(), tostring(kick)) end elseif source == mywind[8] then -- jail nameplayerjail = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) jail = guiGridListGetItemText ( mywind[5], guiGridListGetSelectedItem ( mywind[5] ), 1 ) if jail and nameplayerjail then triggerServerEvent ("jail", getLocalPlayer(), nameplayerjail, jail) end elseif source == mywind[6] then -- unjail nameplayerunjail = guiGridListGetItemText ( mywind[2], guiGridListGetSelectedItem ( mywind[2] ), 1 ) if nameplayerunjail then triggerServerEvent ("unjail", getLocalPlayer(), nameplayerunjail) end end end addEventHandler("onClientGUIClick",root,onClickza) Link to comment
#|_oskar_|# Posted May 18, 2016 Share Posted May 18, 2016 كلنت addEventHandler("onClientGUIClick",jail,function () triggerServerEvent("exe",localPlayer) end,false) سيرفر addEvent("exe",true) addEventHandler("exe",root,function () executeCommandHandler("jail",source) end) ملاحظه : يمكن تحتاج تضيفه لقروب الادمن Link to comment
Adham Posted May 18, 2016 Share Posted May 18, 2016 guiGridListSetItemText(mywind[5],row1,column,"1 min", false, false) guiGridListSetItemColor ( mywind[5], row1, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row2,column,"2 min", false, false) guiGridListSetItemColor ( mywind[5], row2, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row3,column,"3 min", false, false) guiGridListSetItemColor ( mywind[5], row3, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row4,column,"4 min", false, false) guiGridListSetItemColor ( mywind[5], row4, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row5,column,"5 min", false, false) guiGridListSetItemColor ( mywind[5], row5, column, 0, 0, 255 ) ^ سوي Table -- جدول من برا مود جيدتور عشان لو سجنته تقدر تودي السجن Link to comment
w7sH Posted May 18, 2016 Author Share Posted May 18, 2016 كلنت addEventHandler("onClientGUIClick",jail,function () triggerServerEvent("exe",localPlayer) end,false) سيرفر addEvent("exe",true) addEventHandler("exe",root,function () executeCommandHandler("jail",source) end) ملاحظه : يمكن تحتاج تضيفه لقروب الادمن اضفت هذا الكود في اخر كلنكت addEventHandler("onClientGUIClick",jail,function () triggerServerEvent("exe",localPlayer) end,false) واضفت هذا تحت الاوامر addEvent("exe",true) addEventHandler("exe",root,function () executeCommandHandler("jail",source) end) ولا ضبط .. Link to comment
#DRAGON!FIRE Posted May 18, 2016 Share Posted May 18, 2016 كل الاكواد السابقة خطا .. انت تبي تنفذ الكوماند بالمود حقك والكوماند هذا بمود اخر ؟ Link to comment
#|_oskar_|# Posted May 18, 2016 Share Posted May 18, 2016 بموده او يمود اخر نفس الشئ بما ان الكوماند بجانب سيرفر فلازم يسوي الاستخراج حق الكومند سيرفر لان ماينفع يستخرجه بكلنت Link to comment
#DRAGON!FIRE Posted May 19, 2016 Share Posted May 19, 2016 ما ادري وش قصدك انت .. لكن طريقتك اللي شفتها خطا لان الفنكشن نفسه في ارقمنتات ومو حاطها انت وثاني شي سالته اذا بالسكربت نفسه او لا لان في طريقة ثانية احسن Link to comment
#|_oskar_|# Posted May 19, 2016 Share Posted May 19, 2016 ممكن توضح وين الخطاء بالضبط واي ارقمنت نسيته ؟ Link to comment
Mr.CoR Posted May 19, 2016 Share Posted May 19, 2016 guiGridListSetItemText(mywind[5],row1,column,"1 min", false, false) guiGridListSetItemColor ( mywind[5], row1, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row2,column,"2 min", false, false) guiGridListSetItemColor ( mywind[5], row2, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row3,column,"3 min", false, false) guiGridListSetItemColor ( mywind[5], row3, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row4,column,"4 min", false, false) guiGridListSetItemColor ( mywind[5], row4, column, 0, 0, 255 ) guiGridListSetItemText(mywind[5],row5,column,"5 min", false, false) guiGridListSetItemColor ( mywind[5], row5, column, 0, 0, 255 ) ^ سوي Table -- جدول من برا مود جيدتور عشان لو سجنته تقدر تودي السجن ايش هذا بالضبط ؟؟ 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