Skip to content

Passing Parameters #2

@Halogly

Description

@Halogly

Hello author, although it is not a bug, I still want to give some feedback.
When I use trmenu, there is a function that can open the player's menu by right-clicking the player, in which the menu will automatically pass the name of the right-clicked player into the variable {0}. In order to display other parameters or placeholders of this player, I used parseother expansion. The problem with {username} is the biggest, because I can't pass the player's name in by changing it to {{0}}. I discussed it with my friend for a long time, and finally passed the parameter {0} in through the js function. The code is as follows:

  getPAPIParse: |-
    function getPAPIParse(str) {
      return('%' + str.replace("name", vars("{0}")).replace(/-/g, "_").replace(/</g,"{").replace(/>/g,"}") + '%');
    }
    getPAPIParse(args[0]);

name: '${getPAPIParse_parseother-<name>-<player-level>}'
#Make the name of an item display a placeholder for this player

Regarding the player's name, I found that otherplayer expansion can use {0} to pass the player's name, so I hope you can modify these issues of username slightly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions