This site has been archived and made available for preservation purposes. No edits can be made.
GetName
(Difference between revisions)
Return to current revision
-
Retrieves the name of an [wiki]Object[/wiki].
[h="2"] Declaration [/h]
-
-
<code cpp>
VAULTSCRIPT std::string (*GetName)(vaultmp::ID);
-
+
[highlight=cpp]
VAULTSCRIPT vaultmp::String (*GetName)(vaultmp::ID);
-
native GetName(ID, name{});
-
-
</code>
-
+
[/highlight]
-
[h="2"] Parameters [/h]
[b][wiki="ID"]vaultmp::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 std::string containing the name. The PAWN version has no return value.
-
+
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]
-
-
<code cpp>
std::string name;
-
+
[highlight=cpp]
vaultmp::String name;
-
name = GetName(object);
-
-
</code>
-
+
[/highlight]
-
[h="2"] Usage example (PAWN) [/h]
-
-
<code c>
-
+
[highlight=c]
-
new name{MAX_PLAYER_NAME};
GetName(player, name);
-
-
</code>
-
+
[/highlight]
-
[category]VaultMP interface[/category]
[category]Scripting functions[/category]
[category]Object functions[/category]