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

CallPublic

(Difference between revisions)
Return to current revision
  1.  
    Calls a public function.
    [h="2"] Declaration [/h]
  2. -
    <code cpp>
    VAULTSCRIPT vaultmp::Result (*CallPublic)(std::string, ...);
  3. +
    [highlight=cpp]
    VAULTSCRIPT VAULTSPACE Result (*VAULTAPI(CallPublic))(VAULTSPACE cRawString, ...) _CPP(noexcept);
    [/highlight]
    [highlight=c]
  4.  
    native CallPublic(const name{}, {Fixed,Float,_}:...);
  5. -
    </code>
  6. +
    [/highlight]
  7.  
    [h="2"] Parameters [/h]
  8. -
    [b]name[/b] - the public name of the function
  9. +
    [b][wiki]cRawString[/wiki][/b] - the public name of the function
  10.  
    [b]...[/b] - the arguments. Must match the parameter list of the public function.
    [h="2"] Return value [/h]
  11. -
    Returns a [wiki="Result"]vaultmp::Result[/wiki].
  12. +
    Returns a [wiki="Result"]Result[/wiki].
  13.  
    [h="2"] Usage example (C++) [/h]
  14. -
    <code cpp>
    void VAULTSCRIPT exec()
  15. +
    [highlight=cpp]
    Void VAULTSCRIPT exec() noexcept
  16.  
    {
    // MagicFunction is a public function defined in some other script
  17. -
    vaultmp::Result result = CallPublic("MagicFunction", 1, 2, "www.vaultmp.com");
  18. +
    Result result = CallPublic("MagicFunction", 1, 2, "www.vaultmp.com");
  19.  
    }
  20. -
    </code>
  21. +
    [/highlight]
  22.  
    [h="2"] Usage example (PAWN) [/h]
  23. -
    <code c>
  24. +
    [highlight=c]
  25.  
    main()
    {
    // MagicFunction is a public function defined in some other script
    new result = CallPublic("MagicFunction", 1, 2, "www.vaultmp.com");
    }
  26. -
    </code>
  27. +
    [/highlight]
  28.  
    [h="2"] Related pages [/h]
    [list][*][wiki]MakePublic[/wiki]
    [/LIST]
    [category]VaultMP interface[/category]
    [category]Scripting functions[/category]
    [category]Misc functions[/category]