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

GetName

(Difference between revisions)
Return to current revision
  1.  
    Retrieves the name of an [wiki]Object[/wiki].
    [h="2"] Declaration [/h]
    [highlight=cpp]
  2. -
    VAULTSCRIPT vaultmp::String (*GetName)(vaultmp::ID);
  3. +
    VAULTSCRIPT VAULTSPACE cRawString (*VAULTAPI(GetName))(VAULTSPACE ID) VAULTCPP(noexcept);
    [/highlight]
    [highlight=c]
  4.  
    native GetName(ID, name{});
    [/highlight]
    [h="2"] Parameters [/h]
  5. -
    [b][wiki="ID"]vaultmp::ID[/wiki][/b] - the ID of the [wiki]Object[/wiki]
  6. +
    [b][wiki="ID"]ID[/wiki][/b] - the ID of the [wiki]Object[/wiki]
  7.  
    [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]
  8. -
    The C++ version returns a [wiki="String"]vaultmp::String[/wiki] containing the name. The PAWN version has no return value.
    [h="2"] Usage example (C++) [/h]
    [highlight=cpp]
    vaultmp::String name;
    name = GetName(object);
    [/highlight]
    [h="2"] Usage example (PAWN) [/h]
    [highlight=c]
    new name{MAX_PLAYER_NAME};
    GetName(player, name);
    [/highlight]
  9. +
    The C++ version returns a [wiki="cRawString"]cRawString[/wiki]. The PAWN version has no return value.
  10.  
    [category]VaultMP interface[/category]
    [category]Scripting functions[/category]
    [category]Object functions[/category]