Jump to content

[HELP] Members team


Recommended Posts

Hi, Can someone help me im trying to make: when a player registers he will be put in the members team

Can someone help me

here is the CONFIG.XML file:

<teams>
--
Add your teams here. Please note that the resource needs to be restarted for the changes in this file to take effect.
 
Required attributes:
- name: The name of the team
 
Optional attributes:
- color: The color of the team as HTML-Color 
- tag: The clantag the players should have to be put in the team. This does not have to be a clantag of course,
  it can be any part of the nick.
- aclGroup: The ACL Group the player should be in to be put in the team
- required: If set to 'both', both the tag and the aclGroup have to match for a player to be put in the team
(otherwise only one of them has to match, so if you only want players that are in a certain aclGroup
  to get in the team, only define the aclGroup)
 
Example:
<team name="Cool-Clan Members" color="#FF0000" tag="[Cool]" aclGroup="Moderator" required="both" />
 
This will add a team which will be displayed as 'Cool-Clan Members' with red color and to which players will be added
that have '[Cool]' somewhere in their nick and are in the ACL Group 'Moderator'.
-->
 
<team name="Admin(s)" color="#FF0000" tag="[Crew]" aclGroup="Admin" />
<team name="Non - Members" color="#FFFFFF" tag="[Crew]" aclGroup="Everyone" />
<team name="Members" color="#FFFF00" tag="[Crew]" aclGroup="Everyone" />
teams>

Edited by Guest
Link to comment

Ok so, you'll be looking to use this function:

https://wiki.multitheftauto.com/wiki/SetPlayerTeam

In conjunction with:

https://wiki.multitheftauto.com/wiki/GetElementData

The easy way to do it is like so:

if getElementData(thePlayer, registered) then
setPlayerTeam(thePlayer, members)
else
return false
end

^That'd check if the element data has a value for registered, if it does, their team is set, else it returns false and ends.

Ensure that you create the team first with:

https://wiki.multitheftauto.com/wiki/CreateTeam

And that you add the element data with (So the script can see that they're a registered player):

https://wiki.multitheftauto.com/wiki/SetElementData

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...