gghvcffcv Posted March 26, 2014 Share Posted March 26, 2014 Hello guys, How could i restrict this for an ACL Group, i tried but it didn't work, if anyone can help me Please. Server: createTeam ( "SWAT", 0, 0, 255 ) function aceptarr ( ) local theTeam = getTeamFromName ( "SWAT" ) if ( theTeam ) then setPlayerTeam ( source, theTeam ) setPlayerNametagColor ( source, 0, 0, 255 ) setElementModel ( source, 285 ) giveWeapon ( source, 31, 550 ) giveWeapon ( source, 23, 550 ) giveWeapon ( source, 3, 550 ) giveWeapon ( source, 29, 550 ) giveWeapon ( source, 46, 550 ) giveWeapon ( source, 41, 5000 ) end end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", root, aceptarr ) Client: marker5 = createMarker( 1288.17566, -1641.94141, 12.54688, "Cylinder", 1, 0, 0, 255, 200) pedi = createPed ( 285, 1288.17566, -1641.94141, 13.54688, 270) blipA = createBlip ( 1288.17566, -1641.94141, 13.54688, 58, 2, 255, 0,0, 255) function panel(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then local playerTeam = getPlayerTeam ( localPlayer ) if ( playerTeam ) then local oldTeamName = getTeamName ( playerTeam ) if ( oldTeamName ~= "SWAT" ) then setElementFrozen (pedi, true) panel = guiCreateWindow(443, 132, 416, 514, "S.W.A.T Job", false) guiWindowSetSizable(panel, false) aceptar = guiCreateButton(16, 282, 169, 72, "Accept", false, panel) cerrar = guiCreateButton(230, 282, 169, 72, "Close", false, panel) memo = guiCreateMemo(12, 26, 382, 238, "Welcome to the SWAT Job Accept this job if you are an SWAT\nIf you aren't a swat You cannot accept this Job.", false, panel) showCursor (true) addEventHandler ("onClientGUIClick", aceptar, aceptarr, false ) addEventHandler ("onClientGUIClick", cerrar, cerrarr, false ) guiMemoSetReadOnly(memo, true) end end end end addEventHandler("onClientMarkerHit", marker5, panel ) function aceptarr ( thePlayer ) triggerServerEvent ( "onGreeting", localPlayer) guiSetVisible ( panel, false ) showCursor(false) end function cerrarr ( hitElement ) guiSetVisible ( panel, false ) showCursor(false) end Link to comment
Castillo Posted March 26, 2014 Share Posted March 26, 2014 Use the following functions: getPlayerAccount getAccountName aclGetGroup isObjectInACLGroup Link to comment
gghvcffcv Posted March 26, 2014 Author Share Posted March 26, 2014 Use the following functions: getPlayerAccount getAccountName aclGetGroup isObjectInACLGroup function aceptarr () local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "SWAT" ) ) then -- Does he have access to Admin functions? local theTeam = getTeamFromName ( "SWAT" ) if ( theTeam ) then setPlayerTeam ( source, theTeam ) setPlayerNametagColor ( source, 0, 0, 255 ) setElementModel ( source, 285 ) giveWeapon ( source, 31, 550 ) giveWeapon ( source, 23, 550 ) giveWeapon ( source, 3, 550 ) giveWeapon ( source, 29, 550 ) giveWeapon ( source, 46, 550 ) giveWeapon ( source, 41, 5000 ) end end end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", root, aceptarr ) Link to comment
Castillo Posted March 26, 2014 Share Posted March 26, 2014 Change 'thePlayer' to 'source'. Link to comment
Anubhav Posted March 26, 2014 Share Posted March 26, 2014 + remove root from addEventHandler .. it should be source. Link to comment
Castillo Posted March 26, 2014 Share Posted March 26, 2014 No, it has to be 'root', please think before posting. Link to comment
Arnold-1 Posted March 26, 2014 Share Posted March 26, 2014 i think no need for this createTeam ( "SWAT", 0, 0, 255 ) local theTeam = getTeamFromName ( "SWAT" ) just make it local theTeam = createTeam ( "SWAT", 0, 0, 255 ) Link to comment
gghvcffcv Posted March 26, 2014 Author Share Posted March 26, 2014 Change 'thePlayer' to 'source'. thanks you Working Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now