Adham Posted April 28, 2016 Share Posted April 28, 2016 سلام عليكم ابي كود لما يضعط علي البيتون اسمه Send وما كتب شي بالاديت تختفي ال button وترجع تاني انا عامل سبورت سيستم وفيه زر اسمه Send عاوز اليضعط عليها وما كتب شي بالايديت تختفي ال Send الbutton وتيجي تاني Link to comment
[iMr]-W[i]Fi,.! Posted April 28, 2016 Share Posted April 28, 2016 'onClientGUICLick' guiGridListGetSelectedItem setTimer guiSetEnabled 'onClientGUICLick' guiGetText setTimer guiSetEnabled Link to comment
Adham Posted April 28, 2016 Author Share Posted April 28, 2016 ممكن الكود جاهز بس اذنك ولف لو ما تبي اوك. Link to comment
[iMr]-W[i]Fi,.! Posted April 28, 2016 Share Posted April 28, 2016 ممكن الكود جاهز بس اذنك ولف لو ما تبي اوك. addEventHandler('onClientGUIClick',root, function () if source == btn1 then if guiGridListGetSelectedItem == -1 then setTimer(function () guiSetEnabled(btn1,false) end,1000,1) end end end ) addEventHandler('onClientGUIClick',root, function () if source == btn2 then if guiGetText(edit) == ' ' then setTimer(function () guiSetEnabled(btn1,false) end,1000,1) end end end ) Link to comment
Adham Posted April 28, 2016 Author Share Posted April 28, 2016 افهمني انا عاوز حاجة لما ما اكتب شي بالايديت اكتب فاضي واضعط علي button Send تختفي الbutton وترجع Link to comment
SPLM Posted April 28, 2016 Share Posted April 28, 2016 addEventHandler('onClientGUIClick',root, function () if source == BtnSend then local Text = guiGetText(Edit) if Text == "" then guiSetEnabled(BtnSend, false) setTimer( guiSetEnabled, 4500, 1, BtnSend, true) end end end ) Link to comment
Jupi Posted April 28, 2016 Share Posted April 28, 2016 addEventHandler('onClientGUIClick',root, function () if source == BtnSend then local Text = guiGetText(Edit) if Text == "" then guiSetEnabled(BtnSend, false) setTimer( guiSetEnabled, 4500, 1, BtnSend, true) end end end ) المفروض ~= Link to comment
Adham Posted April 28, 2016 Author Share Posted April 28, 2016 طيب انا لما بكتب شي بلايديت واضعط send تختفي برده Link to comment
SPLM Posted April 28, 2016 Share Posted April 28, 2016 addEventHandler('onClientGUIClick',root, function () if source == BtnSend then local Text = guiGetText(Edit) if Text == "" then guiSetEnabled(BtnSend, false) setTimer( guiSetEnabled, 4500, 1, BtnSend, true) end end end ) المفروض ~= سلام عليكم ابي كودلما يضعط علي البيتون اسمه Send وما كتب شي بالاديت تختفي ال button وترجع تاني Link to comment
Adham Posted April 28, 2016 Author Share Posted April 28, 2016 طيب انا عاوز لما يكتب شي ويضعط علي Send ما تختفي تبعت الرساله عادي Link to comment
Jupi Posted April 28, 2016 Share Posted April 28, 2016 addEventHandler('onClientGUIClick',root, function () if source == BtnSend then local Text = guiGetText(Edit) if Text == "" then guiSetEnabled(BtnSend, false) setTimer( guiSetEnabled, 4500, 1, BtnSend, true) end end end ) المفروض ~= سلام عليكم ابي كودلما يضعط علي البيتون اسمه Send وما كتب شي بالاديت تختفي ال button وترجع تاني اها معلش ما لاحظت Link to comment
SPLM Posted April 28, 2016 Share Posted April 28, 2016 (edited) طيب انا عاوز لما يكتب شي ويضعط علي Sendما تختفي تبعت الرساله عادي addEventHandler("onClientGUIClick",GUIEditor.button[1],function () if guiGetText(GUIEditor.edit[1]) ~= "" then triggerServerEvent("support",localPlayer,guiGetText(GUIEditor.edit[1])) guiSetText (GUIEditor.edit[1], "" ) else guiSetEnabled(GUIEditor.button[1], false) setTimer( guiSetEnabled, 4500, 1, GUIEditor.button[1], true) end end, false) تم التحديث Edited April 28, 2016 by Guest Link to comment
Adham Posted April 28, 2016 Author Share Posted April 28, 2016 انا ابي اعمل لما يضط علي Send وما كتب شي بلايديت ولما كتب شي وضعط علي البيتون تبعت عادي الكود بتاعي اهو اليبعت رساله في القريد لست من بيتون send addEventHandler("onClientGUIClick",GUIEditor.button[1],function () if guiGetText(GUIEditor.edit[1]) ~= '' then triggerServerEvent("support",localPlayer,guiGetText(GUIEditor.edit[1])) guiSetText (GUIEditor.edit[1], "" ) end end, false) addEvent("sendmessage2",true) addEventHandler("sendmessage2",root, function(Name,Text) local gg = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1],gg, 1, Name:gsub("#%x%x%x%x%x%x", "") .. " : " .. Text , false, false) guiGridListSetItemColor(GUIEditor.gridlist[1],gg, 1, 0, 255, 0, 255) if ( guiCheckBoxGetSelected( GUIEditor.checkbox[1] ) == true ) then outputChatBox("#ffff00* [support-System] "..Name:gsub("#%x%x%x%x%x%x", "")..": #ffffff"..guiGetText(GUIEditor.edit[1]),255,255,0,true) end end) Link to comment
Adham Posted April 28, 2016 Author Share Posted April 28, 2016 برده يخوي باجي ابعت رساله بتختفي برده Link to comment
nxFairlywell Posted April 28, 2016 Share Posted April 28, 2016 addEventHandler("onClientGUIClick",root, function () if guiGetText(GUIEditor.edit[1]) ~= '' then triggerServerEvent("support",localPlayer,guiGetText(GUIEditor.edit[1])) guiSetText (GUIEditor.edit[1], "" ) else guiSetEnabled(GUIEditor.button[1], false) setTimer(guiSetEnabled, 3000, 1, GUIEditor.button[1], true) end addEvent("sendmessage2",true) addEventHandler("sendmessage2",root, function(Name,Text) local gg = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1],gg, 1, Name:gsub("#%x%x%x%x%x%x", "") .. " : " .. Text , false, false) guiGridListSetItemColor(GUIEditor.gridlist[1],gg, 1, 0, 255, 0, 255) if ( guiCheckBoxGetSelected( GUIEditor.checkbox[1] ) == true ) then outputChatBox("#ffff00* [support-System] "..Name:gsub("#%x%x%x%x%x%x", "")..": #ffffff"..guiGetText(GUIEditor.edit[1]),255,255,0,true) end end ) Link to comment
Adham Posted April 29, 2016 Author Share Posted April 29, 2016 شكرا لك جينرال ممكن طلب اخر؟ ابي تعملي دا يفتح لقروب معين addEventHandler ("onClientGUIClick",GUIEditor.button[3], function () if guiGetText (GUIEditor.edit[1]) == "clr" then return triggerServerEvent ("Clear",localPlayer,getPlayerName(localPlayer)) end --sendMessage code end) addEvent ("CLEAR",true) addEventHandler ("CLEAR",root, function (name) guiGridListClear (GUIEditor.gridlist[1]) rw = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1],rw,1," "..name:gsub("#%x%x%x%x%x%x", "").." - Cleard Chat",false,false) guiGridListSetItemColor(GUIEditor.gridlist[1],rw,1, 0, 0, 1, 0) end) addEvent ("Clear",true) addEventHandler ("Clear",root, function (name) for i,k in ipairs (getElementsByType("player")) do triggerClientEvent (k,"CLEAR",k,name) end end) وعاوز المش معاه القروبتا المحدده يعني لو حد ما معه الرتبة البيتون يكون مقفل يجي في القريد لست * You dont have hh بعدين عاوز الكود كلنت الفوق ما يكتب في الايديت clr يضعط علي البيتون يمسح علطول Link to comment
nxFairlywell Posted April 29, 2016 Share Posted April 29, 2016 (edited) هذي وظيفة سويتها تتحقق اذا اللاعب في القروب اللي بالجدول groupAdmins = {"Console","Admin"} -- حط القروبات اللي تمسح و يكون البوتون عندها مفتوح function isPlayerAdmin( player ) local aPlayerAccount = getPlayerAccount( player ) if ( not aPlayerAccount or isGuestAccount( aPlayerAccount ) ) then return false end local aPlayerAccountName=getAccountName(aPlayerAccount) for _ , Group in ipairs ( groupAdmins ) do if isObjectInACLGroup("user."..aPlayerAccountName, aclGetGroup(Group)) then return true end end end 'onPlayerLogin' -- يوم يدخل اللاعب لحسابه if isPlayerAdmin(source) -- تحقق اذا كان ادمن >> setElementData ( source ) -- عطه داتا -- يوم يفتح اللوحه if getElementData(source) -- تحقق اذا عنده الداتا >> guiSetEnabled(..., true) -- افتح البوتون 'onResourceStart' -- يوم يشتغل السكربت for _ , players in ipairs(getElementsByType("player")) do -- جيب كل اللاعبين if isPlayerAdmin(v) -- تحقق من الادامن >> setElementData(v) -- عطهم داتا هذي بس الطريقة اللي تسوي فيها اللي تبيه و يوم يرسل كلمة كلر تحقق اذا عنده داتا الادمن و سوي guiGridListClear حاول و بساعدك مو كود كامل Edited April 29, 2016 by Guest Link to comment
Adham Posted April 29, 2016 Author Share Posted April 29, 2016 ممكن تعملهولي اخ جينرال الله يوفقكك Link to comment
nxFairlywell Posted April 29, 2016 Share Posted April 29, 2016 ممكن تعملهولي اخ جينرالالله يوفقكك مو صعبه يوم يشتغل السكربت سوي لوب لكل اللاعبين وتحقق من اللاعبين الادامن من خلال الوظيفة اللي عطيتك و عطهم داتا من عندك قيمتها ترو وكذلك مع حدث الدخول للحساب و يوم يضغط ع الزر بالكلنت تحقق اذا اللوكال بلاير عنده داتا اللي انت حطيتها و تساوي ترو و جيب النص من الايديت اذا كان يساوي كلر امسح الشات وبس واذا ماكان اللاعب عنده داتا ارسل الكلمة عادي و لما اللاعب يطلع من حسابه سوي نفس الداتا اللي حطيتها له بس تساوي فولس Link to comment
Adham Posted April 29, 2016 Author Share Posted April 29, 2016 كذا؟ groupAdmins = {"Console","Admin"} -- حط القروبات اللي تمسح و يكون البوتون عندها مفتوح function isPlayerAdmin( player ) local aPlayerAccount = getPlayerAccount( player ) if ( not aPlayerAccount or isGuestAccount( aPlayerAccount ) ) then return false end local aPlayerAccountName=getAccountName(aPlayerAccount) for _ , Group in ipairs ( groupAdmins ) do if isObjectInACLGroup("user."..aPlayerAccountName, aclGetGroup(Group)) then return true end end end addEventHandler("onPlayerLogin",root, function () if isPlayerAdmin(source) setElementData ( source ) end end ) if getElementData(source) guiSetEnabled(button, true) addEventHandler("onResourceStart",root, function () for _ , players in ipairs(getElementsByType("player")) do -- جيب كل اللاعبين if isPlayerAdmin(v) - setElementData(v) end end) 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