Jump to content

طلب تعديل علي كود


Abdo Nour

Recommended Posts

عندي لك وظيفة احسن بس بسويها لك علسريع

tableGroups = { 
  {"Admin"},
  {"Police"},
--- إلخ
}

function removePlayerGroups ( thePlayer )
if ( thePlayer ) then
if ( getElementType(thePlayer) == "player" ) then
if not isGuestAccount(thePlayer) then
for i,ACLGroups in ipairs ( tableGroups ) do
local hisAccountName = getAccountName(getPlayerAccount(thePlayer))
if isObjectInACLGroup ("user."..hisAccountName, aclGetGroup ( ACLGroups[1] ) ) then
aclGroupRemoveObject (aclGetGroup(ACLGroups[1]), "user."..hisAccountName)
end
end
end
else
error("Bad argument #1 the element not a player")
end
else
error("Bad argument #1 player not found")
end
end

هذا بأختصار يحذفلك اي قروب انت تحطه بالجدول الي مسويه لك بالاول

علشان يعني لو ما تبي تحذف رتبته وهو كونسول مثلا

او ما تبي تحذف منه قروبات معينة يعني

ولو في اخطاء ياليت تنبهوني لاني بالجوال + لي كثير ما برمجت شي

Edited by !#DesTroyeR_,)
Link to comment
2 hours ago, !#DesTroyeR_,) said:

عندي لك وظيفة احسن بس بسويها لك علسريع


tableGroups = { 
  {"Admin"},
  {"Police"},
--- إلخ
}

function removePlayerGroups ( thePlayer )
if ( thePlayer ) then
if ( getElementType(thePlayer) == "player" ) then
if not isGuestAccount(thePlayer) then
for i,ACLGroups in ipairs ( tableGroups ) do
local hisAccountName = getAccountName(getPlayerAccount(thePlayer))
if isObjectInACLGroup ("user."..hisAccountName, aclGetGroup ( ACLGroups[1] ) ) then
aclGroupRemoveObject (aclGetGroup(ACLGroups[1]), "user."..hisAccountName)
end
end
end
else
error("Bad argument #1 the element not a player")
end
else
error("Bad argument #1 player not found")
end
end

 

tableGroups = { 
  "Admin",
  "Police",
--- إلخ
}

function removePlayerGroups ( thePlayer )
	if ( isElement(thePlayer) and getElementType( thePlayer ) == 'player' ) then
		if not isGuestAccount(getPlayerAccount(thePlayer)) then			
			local hisAccountName = getAccountName(getPlayerAccount(thePlayer))
			for i , acl in pairs( tableGroups ) do	
				if( aclGetGroup( acl ) ) then
					if(isObjectInACLGroup( "user."..hisAccountName , aclGetGroup(acl) ) ) then
						aclGroupRemoveObject (aclGetGroup(acl), "user."..hisAccountName)
					end
				end          
			end
		end
	else
		error("Bad argument #1 player not found")
	end
end

 

Edited by KillerX
  • Like 1
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...