|
|
(One intermediate revision by the same user not shown) |
Line 1: |
Line 1: |
− | ==Members==
| + | This page has moved to: https://docs.sine.space/v/scripting/client-scripting/player/sgroup |
− | | + | |
− | {{ScriptFunction|bool|IsMemberOf|(int groupID)|Whether is a member of this group.|5=<pre>
| + | |
− | IsMember = Space.Groups.IsMemberOf(675)</pre>|6=<pre>--Clicking this object will check if player is a member of group with ID 350
| + | |
− | --and it will turn green if you are, or red turn if you are not
| + | |
− | thisObject = Space.Host.ExecutingObject
| + | |
− | | + | |
− | | + | |
− | OnClickFunction = function()
| + | |
− | if Space.Groups.IsMemberOf(350) then
| + | |
− | thisObject.Renderer.Material.SetColor("_Color", Color.Green)
| + | |
− | else
| + | |
− | thisObject.Renderer.Material.SetColor("_Color", Color.Red)
| + | |
− | end
| + | |
− | end
| + | |
− | | + | |
− | | + | |
− | thisObject.AddClickable()
| + | |
− | thisObject.Clickable.OnClick(OnClickFunction)</pre>
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|SGroupInfo|GetGroupInfo|(int groupID)|Get the group info by groupID.|5=<pre>
| + | |
− | groupInfo = Space.Groups.GetGroupInfo(675)</pre>|6=<pre></pre>
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|void|JoinGroup|(int groupID, bool <nowiki>force = false</nowiki>)|Shows player a prompt to join specified group. If force is true, the user will not be shown a prompt. (force parameter is white-label only)|5=<pre>Space.Groups.JoinGroup(675)</pre>|6=<pre>--Clicking this object will check if player is in group 350
| + | |
− | --and will prompt the player to leave if they are a member
| + | |
− | --and will prompt them to join if they are not a member
| + | |
− | thisObject = Space.Host.ExecutingObject
| + | |
− | | + | |
− | OnClickFunction = function()
| + | |
− | if Space.Groups.IsMemberOf(350) then
| + | |
− | Space.Groups.LeaveGroup(350)
| + | |
− | else
| + | |
− | Space.Groups.JoinGroup(350)
| + | |
− | end
| + | |
− | end
| + | |
− | | + | |
− | | + | |
− | thisObject.AddClickable()
| + | |
− | thisObject.Clickable.OnClick(OnClickFunction)</pre>
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|void|LeaveGroup|(int groupID, bool <nowiki>force = false</nowiki>)|Shows player a prompt to leave specified group. If force is true, the user will not be shown a prompt. (force parameter is white-label only)|5=<pre>Space.Groups.LeaveGroup(675)</pre>|6=<pre>--Clicking this object will check if player is in group 350
| + | |
− | --and will prompt the player to leave if they are a member
| + | |
− | --and will prompt them to join if they are not a member
| + | |
− | thisObject = Space.Host.ExecutingObject
| + | |
− | | + | |
− | OnClickFunction = function()
| + | |
− | if Space.Groups.IsMemberOf(350) then
| + | |
− | Space.Groups.LeaveGroup(350)
| + | |
− | else
| + | |
− | Space.Groups.JoinGroup(350)
| + | |
− | end
| + | |
− | end
| + | |
− | | + | |
− | | + | |
− | thisObject.AddClickable()
| + | |
− | thisObject.Clickable.OnClick(OnClickFunction)</pre>
| + | |
− | }}
| + | |
− | | + | |
− | | + | |
− | ==Properties==
| + | |
− | | + | |
− | | + | |
− | {{ScriptFunction|SGroupInfo|Membership|{ get; }|Return an array with all the groups this player is a member of|5=<pre>groups = Space.Groups.Membership</pre>|6=<pre></pre>}}
| + | |
− | | + | |
− | {{Scripting Navbox}}
| + | |