Ismaeel_finer Posted June 3, 2017 Share Posted June 3, 2017 (edited) السلام عليكم طلب فنكشنات لما لاعب يدخل للماركر تطهر له لوحة ولوحة مثال تكتب فيه رابط اغنية تشتغل اغنية قروب كونسول فقط هم من يمكنهم دخول للماركر وطهور لوحة لديهم وشكرا Edited June 3, 2017 by Ismaeel_finer Link to comment
' A F . Posted June 3, 2017 Share Posted June 3, 2017 -- # Server Side ; createMarker 'onMarkerHit' getElementType getPlayerAccount + isGuestAccount isObjectInACLGroup triggerClientEvent -- # Client Side ; addEvent addEventHandler guiSetVisible 'onClientGUIClick' guiGetText triggerServerEvent -- اذا تبي الصوت يشتغل للكل -- or playSound Link to comment
#F9SoOoL Posted June 3, 2017 Share Posted June 3, 2017 -- client side function marker () marker1 = createMarker(x, y, z, 'cylinder', 1.5, 255, 255, 255, 255) end addEventHandler("onClientResourceStart", getRootElement(), marker) function a (thePlayer) if ( source == marker1 ) then triggerServerEvent("check", getLocalPlayer()) end end addEventHandler("onClientMarkerHit", getRootElement(), a) -- server side addEvent("check",true) addEventHandler("check", root, function() local account = getAccountName(getPlayerAccount(source)) if ( isObjectInACLGroup("user." ..account, aclGetGroup("Console")) ) then triggerClientEvent(source, "openwin", source) end end) -- client side -- نفترض اسم لوحتك wnd م رح احط اكواد لوحةة ,, اتوقع م فيهه اسهل منها تسويها addEvent("openwin",true) addEventHandler("openwin", root, function () guiSetVisible(wnd,true) showCursor(true) end) هذا الماركر مع التحقق من جروب الكونسسل ,, Link to comment
AHMED MOSTAFA Posted June 3, 2017 Share Posted June 3, 2017 Just now, #F9SoOoL said: -- client side function marker () marker1 = createMarker(x, y, z, 'cylinder', 1.5, 255, 255, 255, 255) end addEventHandler("onClientResourceStart", getRootElement(), marker) function a (thePlayer) if ( source == marker1 ) then triggerServerEvent("check", getLocalPlayer()) end end addEventHandler("onClientMarkerHit", getRootElement(), a) -- server side addEvent("check",true) addEventHandler("check", root, function() local account = getAccountName(getPlayerAccount(source)) if ( isObjectInACLGroup("user." ..account, aclGetGroup("Console")) ) then triggerClientEvent(source, "openwin", source) end end) -- client side -- نفترض اسم لوحتك wnd م رح احط اكواد لوحةة ,, اتوقع م فيهه اسهل منها تسويها addEvent("openwin",true) addEventHandler("openwin", root, function () guiSetVisible(wnd,true) showCursor(true) end) هذا الماركر مع التحقق من جروب الكونسسل ,, اتركه يجرب .. وش استفاد هو كدة ؟ Link to comment
#F9SoOoL Posted June 3, 2017 Share Posted June 3, 2017 1 minute ago, Killer Project said: اتركه يجرب .. وش استفاد هو كدة ؟ كان بآمكاني يالغغالي أحطلههء الككود كآممل ,, بس حبيت اساعدههء ششوي ويككمل البآققي لحآلههء .. :] آشكرك ع الملآحظةة ي ققلبي :] 1 Link to comment
#STZ Posted June 4, 2017 Share Posted June 4, 2017 تشغيل الصوت guiGetText -- Edit to get the link playSound --Ex مثال local text = guiGetText(Edit) local sound = playSound(text) setSoundVolume(sound, 0.5) Link to comment
Ismaeel_finer Posted June 4, 2017 Author Share Posted June 4, 2017 11 hours ago, Killer Project said: اتركه يجرب .. وش استفاد هو كدة ؟ شكرا اخي بس انا سويته وتفتح نافدة لما ادخل ماركر بس امتع قروب كونسول هاده مشكلتي 13 hours ago, Default said: -- # Server Side ; createMarker 'onMarkerHit' getElementType getPlayerAccount + isGuestAccount isObjectInACLGroup triggerClientEvent -- # Client Side ; addEvent addEventHandler guiSetVisible 'onClientGUIClick' guiGetText triggerServerEvent -- اذا تبي الصوت يشتغل للكل -- or playSound مشكور اخي 11 hours ago, #F9SoOoL said: -- client side function marker () marker1 = createMarker(x, y, z, 'cylinder', 1.5, 255, 255, 255, 255) end addEventHandler("onClientResourceStart", getRootElement(), marker) function a (thePlayer) if ( source == marker1 ) then triggerServerEvent("check", getLocalPlayer()) end end addEventHandler("onClientMarkerHit", getRootElement(), a) -- server side addEvent("check",true) addEventHandler("check", root, function() local account = getAccountName(getPlayerAccount(source)) if ( isObjectInACLGroup("user." ..account, aclGetGroup("Console")) ) then triggerClientEvent(source, "openwin", source) end end) -- client side -- نفترض اسم لوحتك wnd م رح احط اكواد لوحةة ,, اتوقع م فيهه اسهل منها تسويها addEvent("openwin",true) addEventHandler("openwin", root, function () guiSetVisible(wnd,true) showCursor(true) end) هذا الماركر مع التحقق من جروب الكونسسل ,, مشكور اخي 1 hour ago, #STZ said: تشغيل الصوت guiGetText -- Edit to get the link playSound --Ex مثال local text = guiGetText(Edit) local sound = playSound(text) setSoundVolume(sound, 0.5) مشكور اخي Link to comment
Ismaeel_finer Posted June 4, 2017 Author Share Posted June 4, 2017 مشكورين شباب انا سويته بس لدي مشكلة لما اضيف قروب تاني مع كونسول مايشتغل قروب تاني addEvent("ofa",true) addEventHandler("ofa", root, function() local account = getAccountName(getPlayerAccount(source)) if ( isObjectInACLGroup("user." ..account, aclGetGroup("Console","LY")) ) then triggerClientEvent(source, "open", source) end end) Link to comment
AHMED MOSTAFA Posted June 4, 2017 Share Posted June 4, 2017 Just now, Ismaeel_finer said: مشكورين شباب انا سويته بس لدي مشكلة لما اضيف قروب تاني مع كونسول مايشتغل قروب تاني addEvent("ofa",true) addEventHandler("ofa", root, function() local account = getAccountName(getPlayerAccount(source)) if ( isObjectInACLGroup("user." ..account, aclGetGroup("Console","LY")) ) then triggerClientEvent(source, "open", source) end end) سوي جدول Link to comment
Ismaeel_finer Posted June 4, 2017 Author Share Posted June 4, 2017 1 minute ago, Killer Project said: سوي جدول addEventHandler("onResourceStart",resourceRoot,function() for i,v in ipairs ( getElementsByType("player") ) do if not ( isGuestAccount(getPlayerAccount(v)) ) then if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "LY" ) ) or isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Console" ) ) or isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Moderator" ) ) then triggerClientEvent(player,"open",player) صح؟ Link to comment
^iiEcoo'x_) Posted June 4, 2017 Share Posted June 4, 2017 local group = { 'Console', 'Admin' } for _ , v in ipairs ( group ) do Link to comment
#BrosS Posted June 4, 2017 Share Posted June 4, 2017 47 minutes ago, Ismaeel_finer said: addEventHandler("onResourceStart",resourceRoot,function() for i,v in ipairs ( getElementsByType("player") ) do if not ( isGuestAccount(getPlayerAccount(v)) ) then if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "LY" ) ) or isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Console" ) ) or isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Moderator" ) ) then triggerClientEvent(player,"open",player) صح؟ يب صح لكن اختصر عليك الامر bGroups = {"Console","Admin","Moderator"} ---- your code for _,v in ipairs(nGroups) do if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( v ) ) ...................... ....... Link to comment
Ismaeel_finer Posted June 4, 2017 Author Share Posted June 4, 2017 6 minutes ago, #BrosS said: يب صح لكن اختصر عليك الامر bGroups = {"Console","Admin","Moderator"} ---- your code for _,v in ipairs(nGroups) do if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( v ) ) ...................... ....... ^_^تمام مشكور Link to comment
Dr.Marco Posted June 4, 2017 Share Posted June 4, 2017 15 hours ago, Killer Project said: اتركه يجرب .. وش استفاد هو كدة ؟ ع اساس انت يكلير ما تعطي جاهز 1 Link to comment
coNolel Posted June 4, 2017 Share Posted June 4, 2017 39 minutes ago, #BrosS said: يب صح لكن اختصر عليك الامر bGroups = {"Console","Admin","Moderator"} ---- your code for _,v in ipairs(nGroups) do if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( v ) ) ...................... ....... bGroups , nGroups ? Link to comment
#BrosS Posted June 4, 2017 Share Posted June 4, 2017 13 minutes ago, coNolel said: bGroups , nGroups ? Lol i didn't notice i hate this phone 1 Link to comment
AHMED MOSTAFA Posted June 4, 2017 Share Posted June 4, 2017 Just now, Dr.Marco said: ع اساس انت يكلير ما تعطي جاهز كنت بعطي زمان .. وخصوصاً الحين اذا اعطيت بترك اكواد واقوله يكملها بنفسه 1 Link to comment
Ismaeel_finer Posted June 4, 2017 Author Share Posted June 4, 2017 1 hour ago, #BrosS said: Lol i didn't notice i hate this phone كودك مشتغلش مختصر ض2 Link to comment
' A F . Posted June 4, 2017 Share Posted June 4, 2017 @#F9SoOoL اذا احد راح يعطي جاهز الباقي ماراح يساعد لانه بيتعب يكتب له الوظائف ويجيك واحد مسوي فاهم ويعطية الكود متى راح ينتهون الناس الي كذا ؟ 2 Link to comment
w7sH Posted June 4, 2017 Share Posted June 4, 2017 addEvent("ofa",true) addEventHandler("ofa", root, function() local account = getPlayerAccount (source) if not isGuestAccount ( account ) then if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then triggerClientEvent(source, "open", source) end end) جرب كذا Link to comment
Ismaeel_finer Posted June 4, 2017 Author Share Posted June 4, 2017 1 hour ago, w7sH said: addEvent("ofa",true) addEventHandler("ofa", root, function() local account = getPlayerAccount (source) if not isGuestAccount ( account ) then if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then triggerClientEvent(source, "open", source) end end) جرب كذا مايشتغلش Link to comment
Ahmed Ly Posted June 5, 2017 Share Posted June 5, 2017 -- Server marker = createMarker(...) Groups = {"Console","LY"} addEventHandler("onMarkerHit",root, function (hit) if source == marker and getElementType(hit) == "player" then acc = getAccountName(getPlayerAccount(hit)) for _,v in ipairs(Groups) do if isObjectInACLGroup("user." ..acc,aclGetGroup (v)) then triggerClientEvent(hit,"open",hit) end end end end ) -- Client addEvent("open",true) addEventHandler("open", root, function () guiSetVisible(wnd,true) showCursor(true) end ) 1 Link to comment
w7sH Posted June 5, 2017 Share Posted June 5, 2017 (edited) 7 hours ago, w7sH said: addEvent("ofa",true) addEventHandler("ofa", root, function() local account = getPlayerAccount (source) if not isGuestAccount ( account ) then if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then triggerClientEvent(source, "open", source) end end end) جرب كذا الحين واذا فيه أخطأ قلي وش يطلع فالدي بق نسيت end Edited June 5, 2017 by w7sH Link to comment
Master_MTA Posted June 5, 2017 Share Posted June 5, 2017 (edited) 3 hours ago, w7sH said: جرب كذا الحين واذا فيه أخطأ قلي وش يطلع فالدي بق نسيت end ليه مصعب الامور local gr={'Console','Admin','test'} addEvent("ofa",true) addEventHandler("ofa", root, function() local account = getPlayerAccount (source) if isGuestAccount ( account ) then return end for k=1,#gr do if isObjectInACLGroup("user." .. getAccountName(account), aclGetGroup(gr[k])) then triggerClientEvent(source, "open", source) break end end end) كذا الكود ما اخذ مساحه وصار ابسط Edited June 5, 2017 by Master_MTA 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