Jullul7000 Posted August 13, 2013 Share Posted August 13, 2013 why is it not working ??? everyone can use the command local allowedGroups = {"Owner", "HeadAdmin", "SuperModerator", "Moderator", "Trialstaff"} local Staff = createTeam ( "Staff", 126, 0, 145 ) function SetSkinAndTeam ( player ) setElementModel ( player, 217 ) setPlayerTeam ( player, Staff ) end addCommandHandler ( "staff", SetSkinAndTeam ) Link to comment
tosfera Posted August 13, 2013 Share Posted August 13, 2013 try it this way; addEventHandler("onResourceStart", getRootElement(getThisResource()), function() Staff = createTeam ( "Staff", 126, 0, 145 ); end ); addCommandHandler ( "staff", function ( player, command ) setElementModel ( player, 217 ); setPlayerTeam ( player, getTeamFromName("Staff") ); end ); Link to comment
Castillo Posted August 13, 2013 Share Posted August 13, 2013 Is because is not being restricted at all, use this: local allowedGroups = { "Owner", "HeadAdmin", "SuperModerator", "Moderator", "Trialstaff" } local Staff = createTeam ( "Staff", 126, 0, 145 ) function SetSkinAndTeam ( player ) local account = getPlayerAccount ( player ) if ( not isGuestAccount ( account ) ) then local accountName = getAccountName ( account ) for _, group in ipairs ( allowedGroups ) do if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( group ) ) then setElementModel ( player, 217 ) setPlayerTeam ( player, Staff ) break end end end end addCommandHandler ( "staff", SetSkinAndTeam ) 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