Jump to content

Recommended Posts

السلام عليكم طلب فنكشنات

لما لاعب يدخل للماركر تطهر له لوحة ولوحة مثال تكتب فيه رابط اغنية تشتغل اغنية

قروب كونسول فقط هم من يمكنهم دخول للماركر وطهور لوحة لديهم 

وشكرا

Edited by Ismaeel_finer
Link to comment
-- # Server Side ;
createMarker
'onMarkerHit'
getElementType
getPlayerAccount + isGuestAccount
isObjectInACLGroup
triggerClientEvent
-- # Client Side ; 
addEvent
addEventHandler
guiSetVisible
'onClientGUIClick'
guiGetText
triggerServerEvent -- اذا تبي الصوت يشتغل للكل 
-- or playSound

 

Link to comment
-- 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
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
1 minute ago, Killer Project said:


اتركه يجرب .. وش استفاد هو كدة ؟

كان بآمكاني يالغغالي أحطلههء الككود كآممل ,, بس حبيت اساعدههء ششوي ويككمل البآققي لحآلههء .. :]

آشكرك ع الملآحظةة ي ققلبي :]

  • Like 1
Link to comment
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

مشكورين شباب انا سويته بس لدي مشكلة
لما اضيف قروب تاني مع كونسول مايشتغل قروب تاني

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
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
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
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
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
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
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
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
-- 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
)

 

  • Like 1
Link to comment
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 by w7sH
Link to comment
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 by Master_MTA
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...