isOwner: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
mNo edit summary
(missing 'player' as first parameter)
Line 3: Line 3:
|version=1.3b48
|version=1.3b48
|description=
|description=
Returns {{true}} if the [[Player]] is an owner of a specific [[Token]].
Returns {{true}} if the given [[Player]] is an owner of a specific [[Token]].


|usage=
|usage=
Line 10: Line 10:
</source>
</source>
<source lang="mtmacro" line>
<source lang="mtmacro" line>
isOwner(id)
isOwner(player)
</source>
</source>
'''Parameter'''
<source lang="mtmacro" line>
isOwner(player, id)
</source>
'''Parameters'''
{{param|plyer|The name of the player to check for ownership, defaults to the [[Current Player]]. }}
 
{{param|id|The token {{code|id}} of the token which is checked for ownership, defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{param|id|The token {{code|id}} of the token which is checked for ownership, defaults to the [[Current Token]]. {{TrustedParameter}} }}


|examples=
|examples=
Returns {{code|You can edit me.}} if the [[Current Token]] is owned by the [[Player]].
Returns {{code|You can edit me.}} if the [[Current Player]] is an owner of the [[Current Token]].
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[r, if(isOwner()): "You can edit me."]
[r, if(isOwner()): "You can edit me."]
</source>
Returns {{code|Azhrei can edit me.}} if the given [[Player]] is an owner of the given [[Token]].
<source lang="mtmacro" line>
[h: id = getSelected() ]
[r, if(isOwner("Azhrei", id)): "Azhrei can edit me."]
</source>
</source>



Revision as of 15:15, 10 August 2010

isOwner() Function

Introduced in version 1.3b48
Returns true(1) if the given Player is an owner of a specific Token.

Usage

isOwner()
isOwner(player)
isOwner(player, id)

Parameters

  • plyer - The name of the player to check for ownership, defaults to the Current Player.
  • id - The token id of the token which is checked for ownership, defaults to the Current Token.

     Note: This parameter can only be used in a Trusted Macro

Examples

Returns You can edit me. if the Current Player is an owner of the Current Token.
[r, if(isOwner()): "You can edit me."]

Returns Azhrei can edit me. if the given Player is an owner of the given Token.

[h: id = getSelected() ]
[r, if(isOwner("Azhrei", id)): "Azhrei can edit me."]

See Also

Version Changes

  • 1.3b51 - Added id parameter option.