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

Results 1 to 2 of 2

Thread: [Bug] CallPublic

  1. #1

    [Bug] CallPublic

    Hi, when I want to call the public, I get an error: Public with name _test does not exist

    code:

    PHP Code:
    //OnGameModeInit
    CallPublic cmdnameID" " ) ; //cmdname = "_test"

    //separate public
    forward _testplayeridparams { } ) ;
    public 
    _testplayeridparams { } ) {    return print ( "Test Command" ) ;} 
    debug log: https://pastebin.com/078tjL6u
    Last edited by Debug; 07-20-2013 at 09:46 PM.

  2. #2
    Administrator
    Join Date
    Jun 2011
    Location
    Germany
    Posts
    1,057
    Blog Entries
    5
    You can only call functions which have been made public with MakePublic (<- click the link). This should work:

    Code :
    //OnGameModeInit
    MakePublic("_test", "_test", "is");
    CallPublic ( cmdname, ID, " " ) ; //cmdname = "_test"
     
    //separate public
    forward _test( playerid, params { } ) ;
    public _test( playerid, params { } ) {    return print ( "Test Command" ) ;}

    This is so these functions can be called from C/C++ scripts as well (and vice-versa).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •