Help
Remember Me?
Home
Forum
Download
Scripting docs
Wiki
Main
Special Pages
Books
Recent Changes
Blogs
Wiki
Main
MakePublic
This site has been archived and made available for preservation purposes. No edits can be made.
If this is your first visit, be sure to check out the
FAQ
by clicking the link above. You may have to
register
before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
article
discussion
source
history
Viewing source for:
MakePublic
Makes a function public. A public function can be called from other scripts. [h="2"] Declaration [/h] [highlight=cpp] VAULTSCRIPT VAULTSPACE Void (*VAULTAPI(MakePublic))(VAULTSPACE RawFunction(), VAULTSPACE cRawString, VAULTSPACE cRawString) VAULTCPP(noexcept); [/highlight] [highlight=c] native MakePublic(const func{}, const name{}, const def{}); [/highlight] [h="2"] Parameters [/h] [b][wiki="Function"]Function[/wiki][/b] - the function [b][wiki]cRawString[/wiki][/b] - the public name of the function (must be unique) [b][wiki]cRawString[/wiki][/b] - the parameter list of the function. This is a string containing a sequence of: [list][*]i - Integer (4 byte) [*]l - Long integer (8 byte) [*]f - Floating-point (8 byte) [*]p - Pointer (4 byte) [*]s - String (const char*) [/LIST] [h="2"] Return value [/h] None. [h="2"] Usage example (C++) [/h] [highlight=cpp] Result VAULTSCRIPT MyPublic(unsigned int a, unsigned int b, const char* c) { // Public function return static_cast<Result>(a + b); } Void VAULTSCRIPT exec() noexcept { // C++ template version (type-safe, deduces type string) MakePublic(MyPublic, "MagicFunction"); } [/highlight] [h="2"] Usage example (PAWN) [/h] [highlight=c] forward MyPublic(a, b, const c{}); public MyPublic(a, b, const c{}) { // Public function return (a + b); } main() { MakePublic("MyPublic", "MagicFunction", "iis"); } [/highlight] [h="2"] Related pages [/h] [list][*][wiki]CallPublic[/wiki] [/LIST] [category]VaultMP interface[/category] [category]Scripting functions[/category] [category]Misc functions[/category]