rafull6 Posted June 28, 2011 Posted June 28, 2011 Hello guys. I have few questions about scoreboard. I tried to find the answers, but i failed. Help me with it please. (P.S. I'm usind DXscoreboard https://community.multitheftauto.com/index.php?p=resources&s=details&id=419) 1st question: How to add columns like a "kills", "death", "money" ( i saw a lot of examples, but they do not work for me) 2nd question: How to make teams like "Players", "Members" (screenshot): 3rd question: How to paint all player blips and their names in yellow colour (for example), and make member colours blue (for example). Mey be that's very easy for you guys, but it's pretty hard for me, because I'm begginer in lua, so, please help me with it
Piorun Posted June 28, 2011 Posted June 28, 2011 For your 1st question: here you've got a few functions of dxscoreboard resource: https://wiki.multitheftauto.com/wiki/Dxscoreboard . As you can see there is a "scoreboardAddColumn" function so use that. For your 2nd question: hmm ... createTeam??? And in dxscoreboard set "show teams" to "yes"
JR10 Posted June 28, 2011 Posted June 28, 2011 For your 3rd question: for thier names: setPlayerNametagColor createBlipAttachedTo -- got 3 arguments RGB to set the color
rafull6 Posted June 28, 2011 Author Posted June 28, 2011 About my 2nd question "How to make teams like "Players", "Members"..." So i enabled in dxscoreboard "show teams". But how to connect it with ACL. I want to make next: when player connects to the server it checks him in ACL groups and move to the team in scoreboard. For example: all defoult players will be moved to the group "Users", members admins and moderators to "Members" in scoreboard. How to do that?
JR10 Posted June 28, 2011 Posted June 28, 2011 create both teams Members and Users on player join check if he is in the acl group and set his team like this Members = createTeam('Members') Users = createTeam('Users') addEventHandler('onPlayerJoin', root, function() -- check if he is admin according to you it's not with account because it's onPlayerJoin so this is with name not the best way to do it if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "Groupname" ) ) then setPlayerTeam(source, Members) else setPlayerTeam(source, Users) end end )
rafull6 Posted June 28, 2011 Author Posted June 28, 2011 JR10, works great! Thanks =) BUT!!! It doesn't want to transfer me to admin team (even after logging) (((
JR10 Posted June 28, 2011 Posted June 28, 2011 Did you edit it? it was just an example you should edit /add more checking for groups. Example: if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "Moderators" ) ) then you can add more.
JR10 Posted June 28, 2011 Posted June 28, 2011 You can do that too, but there might be 2 groups with the same permission so use isObjectInACLGroup.
eAi Posted June 28, 2011 Posted June 28, 2011 We strongly advise that you don't use isObjectInACLGroup, and that you should use hasObjectPermissionTo. You can make your own ACL right for whatever feature you're trying to restrict access to. This is especially true if you want to share your script - there's no reason you should expect other server admins to have an 'admin' ACL group, or that you should assume you know what group they want to be able to use your feature.
Klesh Posted June 28, 2011 Posted June 28, 2011 There is a resource with you can get kills and deaths, this resource comes with MTA, you must start with admin panel, the name of the resource is scores, start it and you will see, but dont you think the kills and all that will be saved because you must to create some script for that.
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