(Difference between revisions)
Return to current revision
-
-
Gets called when a player requests to play on this server (before [[OnSpawn]] and after [[OnClientAuthenticate]]). It is recommended to make sure that every player gets a unique [[Base|vaultmp::Base]].
== Declaration ==
<code cpp>
VAULTSCRIPT vaultmp::Base OnPlayerRequestGame(vaultmp::ID);
-
+
Gets called when a [wiki]Player[/wiki] requests to play on this server (before [wiki]OnSpawn[/wiki] and after [wiki]OnClientAuthenticate[/wiki]). It is recommended to make sure that every [wiki]Player[/wiki] gets a unique [wiki="Base"]Base[/wiki].
[h="2"] Declaration [/h]
[highlight=cpp]
VAULTSCRIPT VAULTSPACE NPC_ OnPlayerRequestGame(VAULTSPACE ID) VAULTCPP(noexcept);
[/highlight]
[highlight=c]
-
forward OnPlayerRequestGame(ID);
-
-
</code>
== Parameters ==
'''[[ID|vaultmp::ID]]''' - the ID of the [[Player]]
== Return value ==
You have to return a [[Base|vaultmp::Base]]. This is the model which will represent the Player in-game.
== Usage example (C++) ==
<code cpp>
vaultmp::Base VAULTSCRIPT OnPlayerRequestGame(ID player)
{
Base base = 0x00000000;
base = 0x00030D82; // Carter from Fallout 3
return base;
}
</code>
-
+
[/highlight]
[h="2"] Parameters [/h]
[b][wiki="ID"]ID[/wiki][/b] - the ID of the [wiki]Player[/wiki]
[h="2"] Return value [/h]
You have to return a [wiki="NPC_"]NPC_[/wiki]. This is the model which will represent the [wiki]Player[/wiki] in-game. By returning zero, vaultmp will automatically choose a currently unused model.
[category]VaultMP interface[/category]
[category]Scripting callbacks[/category]