Admigo Posted September 9, 2011 Share Posted September 9, 2011 Heey guys, How can i detect if a player is admin and put him in admin team.(setplayerteam). I need this for dxscoreboard. Thanks admigo Link to comment
Admigo Posted September 9, 2011 Author Share Posted September 9, 2011 Lol i dunno where to add it:P I just use dxscoreboard. Link to comment
Baseplate Posted September 9, 2011 Share Posted September 9, 2011 add a column in the dxscoreobard do isObjectInACLGroup ("Admin") and like that Link to comment
TAPL Posted September 9, 2011 Share Posted September 9, 2011 https://wiki.multitheftauto.com/wiki/CreateTeam https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup https://wiki.multitheftauto.com/wiki/SetPlayerTeam https://wiki.multitheftauto.com/wiki/OnPlayerLogin Link to comment
Sora Posted September 12, 2011 Share Posted September 12, 2011 (edited) hmmm this code is alright ? function createTeamsOnStart () teamAdmmin = createTeam ( "Admin", 0, 255, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) local root = getRootElement() addEventHandler("onPlayerLogin", root if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then local theTeam = getPlayerTeam ( source ) if theTeam then setPlayerTeam ( source, Admin ) end end Edited September 20, 2011 by Guest Link to comment
Axel Posted September 12, 2011 Share Posted September 12, 2011 (edited) You should use [lua ] [/lua] for the code.. Edited September 12, 2011 by Guest Link to comment
BinSlayer1 Posted September 12, 2011 Share Posted September 12, 2011 1. playerName doesn't exist 2. why would you get the team of the source? Simply set his team if acl finds him as being an admin Link to comment
bandi94 Posted September 12, 2011 Share Posted September 12, 2011 teamAdmin = createTeam ( "Admin", 0, 255, 0 ) function addtoteam(player) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Admin" ) ) then setPlayerTeam ( player,teamAdmin ) end end function addtoteamtimer() setTimer(addtoteam,3000,1,source) end addEventHandler("onPlayerLogin",getRootElement(),addtoteamtimer) Link to comment
Jaysds1 Posted September 12, 2011 Share Posted September 12, 2011 What's the timer for bandi? Link to comment
bandi94 Posted September 12, 2011 Share Posted September 12, 2011 when i make my autoteam i use only onPlayerJoin onPlayerLogin .... and i get bad argument's get Player Name account .. and that timer make a litel time after Login to don't get Bad argument's Link to comment
Sora Posted September 20, 2011 Share Posted September 20, 2011 & For all Admins , Supermoderator , moderator use this code , i'm just added *else* to code teamAdmin = createTeam ( "Admin", 255, 0, 0 ) function addtoteam(player) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Admin" ) ) then setPlayerTeam ( player,teamAdmin ) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "SuperModerator" ) ) then setPlayerTeam ( player,teamAdmin ) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Moderator" ) ) then setPlayerTeam ( player,teamAdmin ) end end function addtoteamtimer() setTimer(addtoteam,3000,1,source) end addEventHandler("onPlayerLogin",getRootElement(),addtoteamtimer) i'm sure it's working Link to comment
TAPL Posted September 20, 2011 Share Posted September 20, 2011 also there an other way by check if is has permission to command kick .... Link to comment
CapY Posted September 20, 2011 Share Posted September 20, 2011 Or easier "general.adminpanel" 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