This site has been archived and made available for preservation purposes. No edits can be made.

GetName

(Difference between revisions)
Return to current revision
Current Revision 11-17-2012, 01:19 AM
  1. -
    Retrieves the name of an [[Object]].

    == Declaration ==
    <code cpp>
    VAULTSCRIPT std::string (*GetName)(vaultmp::ID);
  2. +
    Retrieves the name of an [wiki]Object[/wiki].
    [h="2"] Declaration [/h]
    [highlight=cpp]
    VAULTSCRIPT VAULTSPACE cRawString (*VAULTAPI(GetName))(VAULTSPACE ID) VAULTCPP(noexcept);
    [/highlight]
    [highlight=c]
  3.  
    native GetName(ID, name{});
  4. -
    </code>
    == Parameters ==

    '''[[ID|vaultmp::ID]]''' - the ID of the Object

    '''name''' - an array large enough to hold [[MAX_PLAYER_NAME]] characters (PAWN only)

    == Return value ==

    The C++ version returns a std::string containing the name. The PAWN version has no return value.

    == Usage example (C++) ==

    <code cpp>
    std::string name;
    name = GetName(object);
    </code>

    == Usage example (PAWN) ==

    <code c>
    new name{MAX_PLAYER_NAME};
    GetName(object, name);
    </code>
  5. +
    [/highlight]
    [h="2"] Parameters [/h]
    [b][wiki="ID"]ID[/wiki][/b] - the ID of the [wiki]Object[/wiki]
    [b]name[/b] (PAWN only) - an array large enough to hold at least [wiki]MAX_PLAYER_NAME[/wiki] characters. Note that [wiki="Object"]Objects[/wiki] which are not [wiki="Player"]Players[/wiki] can have longer names
    [h="2"] Return value [/h]
    The C++ version returns a [wiki="cRawString"]cRawString[/wiki]. The PAWN version has no return value.
    [category]VaultMP interface[/category]
    [category]Scripting functions[/category]
    [category]Object functions[/category]