gghvcffcv Posted March 26, 2014 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
Castillo Posted March 26, 2014 Posted March 26, 2014 Use the following functions: getPlayerAccount getAccountName aclGetGroup isObjectInACLGroup San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
gghvcffcv Posted March 26, 2014 Author 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 )
Castillo Posted March 26, 2014 Posted March 26, 2014 Change 'thePlayer' to 'source'. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Anubhav Posted March 26, 2014 Posted March 26, 2014 + remove root from addEventHandler .. it should be source. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Castillo Posted March 26, 2014 Posted March 26, 2014 No, it has to be 'root', please think before posting. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Arnold-1 Posted March 26, 2014 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 ) Ingame Name: Arnold If you need my help, contact me on Skype @bshr.ara NOTE:DO NOT ASK ME FOR SCRIPTS, ASK ME FOR HELP
gghvcffcv Posted March 26, 2014 Author Posted March 26, 2014 Change 'thePlayer' to 'source'. thanks you Working
Castillo Posted March 26, 2014 Posted March 26, 2014 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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