AR/aclGetGroup: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 1: Line 1:
هاذي الوضيفة تجيب قروب ( مجموعة ) من الأسل عن طريق الأسم
==Syntax==  
==Syntax==  
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd -->
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd -->

Revision as of 15:52, 7 April 2013

هاذي الوضيفة تجيب قروب ( مجموعة ) من الأسل عن طريق الأسم

Syntax

aclgroup aclGetGroup ( string groupName )

العناصر المطلوبة

  • groupName: اسم القروب ( المجموعة ) التي تريد احضارها


Returns

Returns اذا تم العثور على القروب. الرجوع اليه false/nil اذا لم يوجد القروب او فشل بسبب غير معروف.

مثال


players = getElementsByType ( "player" )
admins = ""
for k,v in ipairs(players) do
   local accountname = ""
   if (isGuestAccount(getPlayerAccount(v)) == false) then
      accountname = getAccountName (getPlayerAccount(v))
      if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then
         if (admins == "") then
            admins = getPlayerName(v)
         else
            admins = admins .. ", " .. getPlayerName(v)
         end
      end
   end
end
outputChatBox( "Online Admins:", getRootElement(), 255, 255, 0)
outputChatBox( " " .. tostring ( admins ), getRootElement(), 255, 255, 0)