Admigo Posted September 9, 2011 Share Posted September 9, 2011 Heey guys, How can i make a group from players and a group of admins in the dxscoreboard? And how can i detect it? Pls give me full code. I really need it:P Thanks Admigo Link to comment
JR10 Posted September 9, 2011 Share Posted September 9, 2011 This is not a request forum. isObjectInACLGroup, hasObjectPermissionTo, setElementData Link to comment
Admigo Posted September 9, 2011 Author Share Posted September 9, 2011 Sorry i dont understand this. Pls full code. Link to comment
Castillo Posted September 9, 2011 Share Posted September 9, 2011 We're not going to give you the "full" code, start learning. Link to comment
TAPL Posted September 10, 2011 Share Posted September 10, 2011 again https://wiki.multitheftauto.com/wiki/CreateTeam https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup https://wiki.multitheftauto.com/wiki/SetPlayerTeam https://wiki.multitheftauto.com/wiki/OnPlayerLogin First try by yourself and if you got problem put your code there and we will help you Link to comment
Admigo Posted September 10, 2011 Author Share Posted September 10, 2011 Thanks guys,Now i have 2 colums with players and admins. But if i login or join the game i am not in both of them. Code: function createTeamsOnStart () teamAdmin = createTeam ( "Admins", 0, 255, 0 ) --change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, and the last one is ColourB teamPlayers = createTeam ( "Players", 200, 0, 100 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) --we attach the function to this resource's root element addEventHandler("onPlayerLogin", root, function() local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then setPlayerTeam ( theplayer, Admins ) end end ) Pls help. Link to comment
bandi94 Posted September 10, 2011 Share Posted September 10, 2011 (edited) try this local teamAdmin local teamPlayers function createTeamsOnStart () teamAdmin = createTeam ( "Admins", 0, 255, 0 ) --change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, and the last one is ColourB teamPlayers = createTeam ( "Players", 200, 0, 100 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) --we attach the function to this resource's root element function setteam(player) local account = getPlayerAccount(player) if not account or isGuestAccount(account) then setPlayerTeam ( player, teamPlayers ) return end local accName = getAccountName ( account) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then setPlayerTeam ( player, teamAdmin) else setPlayerTeam ( player, teamPlayers ) end end function timer() setTimer(setteam,3000,1,source) end addEventHandler("onPlayerLogin",getRootElement(),timer) addEventHandler("onPlayerJoin",getRootElement(),timer) Edited September 10, 2011 by Guest Link to comment
Admigo Posted September 10, 2011 Author Share Posted September 10, 2011 Dont work. I am just not in players and not in admins. JUst outside the groups. Link to comment
bandi94 Posted September 10, 2011 Share Posted September 10, 2011 copy paste again the code i edit it Link to comment
Admigo Posted September 10, 2011 Author Share Posted September 10, 2011 I get 2 errors: Bad Argument @ getPlayerAccount and Bad Argument @ setPlayerTeam. Link to comment
bandi94 Posted September 10, 2011 Share Posted September 10, 2011 copy paste again i make some change's Link to comment
Admigo Posted September 10, 2011 Author Share Posted September 10, 2011 Omg Thank you so much,Its working now;) 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