سويته لكـ مختصر اكثر بزر واحد يشيله او يرجعه
Client Side !
addEventHandler( "onClientGUIClick", resourceRoot, function( )
if ( source == button ) then
if ( guiGridListGetSelectedItem ( TheGrid ) ~= -1 ) then
local select = guiGridListGetItemText ( TheGrid, guiGridListGetSelectedItem ( TheGrid ), 1 )
triggerServerEvent( "addOrRemoveGroup", localPlayer, select )
end
end
end )
Server Side !
local GroupName = "Police"
addEvent( "addOrRemoveGroup", true )
addEventHandler( "addOrRemoveGroup", root, function( select )
local account = getAccountName( getPlayerAccount( select ) )
if not ( isObjectInACLGroup("user."..account, aclGetGroup( GroupName ) ) ) then
aclGroupAddObject ( aclGetGroup( GroupName ), "user."..account)
else
aclGroupRemoveObject ( aclGetGroup( GroupName ), "user."..account)
end
end )