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>
  3. +
    [highlight=cpp]
  4.  
    VAULTSCRIPT vaultmp::Result (*CallPublic)(std::string, ...);
    native CallPublic(const name{}, {Fixed,Float,_}:...);
  5. -
    </code>
  6. +
    [/highlight]
  7.  
    [h="2"] Parameters [/h]
    [b]name[/b] - the public name of the function
    [b]...[/b] - the arguments. Must match the parameter list of the public function.
    [h="2"] Return value [/h]
    Returns a [wiki="Result"]vaultmp::Result[/wiki].
    [h="2"] Usage example (C++) [/h]
  8. -
    <code cpp>
    void VAULTSCRIPT exec()
  9. +
    [highlight=cpp]
    vaultmp::Void VAULTSCRIPT exec()
  10.  
    {
    // MagicFunction is a public function defined in some other script
    vaultmp::Result result = CallPublic("MagicFunction", 1, 2, "www.vaultmp.com");
    }
  11. -
    </code>
  12. +
    [/highlight]
  13.  
    [h="2"] Usage example (PAWN) [/h]
  14. -
    <code c>
  15. +
    [highlight=c]
  16.  
    main()
    {
    // MagicFunction is a public function defined in some other script
    new result = CallPublic("MagicFunction", 1, 2, "www.vaultmp.com");
    }
  17. -
    </code>
  18. +
    [/highlight]
  19.  
    [h="2"] Related pages [/h]
    [list][*][wiki]MakePublic[/wiki]
    [/LIST]
    [category]VaultMP interface[/category]
    [category]Scripting functions[/category]
    [category]Misc functions[/category]