Jump to content

ACL HELP


TusCan

Recommended Posts

i wanna The Player can take The Job Only if he's in aclGroup.

function createGovernemntTeam () 
    governemntTeam = createTeam ( "Governemnt", 220, 140, 100 ) 
end 
addEventHandler ( "onResourceStart", resourceRoot, createGovernemntTeam ) 
  
addEvent ( "governemntJobAccepted", true ) 
function givePlayerJob ( ) 
    setPlayerTeam ( source, governemntTeam ) 
     setElementModel ( source, 286 ) 
      setElementData( source, "Job", "FBI", true ) 
       setElementData( source, "Rank", "Federal agent", true ) 
         exports ["damned"] : outputServer ( source, "Job:You are now Employed as a Federal Agent." , 220, 140, 100 ) 
end 
addEventHandler ( "governemntJobAccepted", root, givePlayerJob ) 

Client Side :

     
function resourceBootUp () 
    ourPed = createPed ( 286, 1287.7822265625, -1660.2741699219, 13.546875 )    
     ourBlip = createBlipAttachedTo ( ourPed, 41 ) 
      setBlipVisibleDistance ( ourBlip, 300 ) 
       setElementFrozen ( ourPed, true ) 
        setElementRotation ( ourPed, 0, 0, 0 ) 
         setElementInterior ( ourPed, 0 ) 
          setElementDimension ( ourPed, 0 ) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, resourceBootUp ) 
  
  
local governemntWindow = guiCreateWindow ( 0.4000, 0.5000, 0.5000, 0.5000, "Governemnt Job GUI", true ) 
local governemntLabel = guiCreateLabel ( 0.0999, 0.0799, 0.9919, 0.2015, "Governemnt Job - .", true, governemntWindow ) 
guiLabelSetColor ( governemntLabel, 255, 0, 0 ) 
guiLabelSetHorizontalAlign ( governemntLabel, "center", false ) 
guiSetFont ( governemntLabel, "default-bold-small" ) 
local governemntInfoLabel = guiCreateLabel ( 0.0309, 0.2441, 0.944, 0.3077, "If you accept this job, you are able to rob houses. \nDrive to the blip created on your minimap (an house icon) Once you enter the marker\nyou will get paid.\nAnd another house will be able to be robbed.", true, governemntWindow ) 
local governemntAcceptButton = guiCreateButton ( 0.3544 ,0.7923, 0.1415, 0.1232, "Accept", true, governemntWindow ) 
local governemntCloseButton = guiCreateButton ( 0.5302, 0.7593, 0.1419, 0.1304, "Close", true, governemntWindow ) 
guiSetVisible ( governemntWindow, false ) 
  
  
function detectClickOnPed ( button, state, absX, absY, wx, wy, wz, element ) 
    if ( element and element == ourPed and not isPedInVehicle ( localPlayer ) ) then 
        local x, y, z = getElementPosition ( localPlayer ) 
         if ( getDistanceBetweenPoints3D ( x, y, z, wx, wy, wz ) <= 3 ) then 
            guiSetVisible ( governemntWindow, true ) 
        end 
    end 
end 
addEventHandler ( "onClientClick", root, detectClickOnPed ) 
  

Link to comment

You can simply use this code

local account=getAccountName(getPlayerAccount(player)) 
if(isObjectInACLGroup("user."..account,aclGetGroup("Admin")))then 
-- the rest 

P.S. aware that the event defines the player , so you should replace ' player ' with where the event defines.

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