Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
StyledStrike committed May 20, 2024
1 parent 381dfbe commit bb89ba4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ You can check a Player's squad by calling this function:
-- Available both on SERVER and CLIENT.
-- Will be -1 if this player is not in a squad.
local id = Player:GetSquadID()
```

You can use this function to get a specific squad instance:

-- You can use this function to get the squad instance.
```lua
local squad = SquadMenu:GetSquad( id )

--[[
Expand All @@ -32,12 +35,14 @@ local squad = SquadMenu:GetSquad( id )
squad.enableRings - boolean
squad.friendlyFire - boolean
squad.isPublic - boolean
]]

squad.members - Player[]
-- You can get the player entities that are part of the squad with:
local players = squad:GetActiveMembers()

Please do not modify squad.members directly.
Check out squad:AddMember and squad:RemoveMember if you need to.
]]
-- "p" represents a player Entity or a string you can get from SquadMenu.GetPlayerId:
squad:AddMember( p )
squad:RemoveMember( p, reason ) -- reason is a number from SquadMenu.LEAVE_REASON_*
```

You can also filter the squad name before it's assigned by using the `ShouldAllowSquadName` hook **on the server**.
Expand Down

0 comments on commit bb89ba4

Please sign in to comment.