Issue With ******'s Hooking When Having Strings as Parameter
#1

I'm hooking my callbacks according to this method: https://sampforum.blast.hk/showthread.php?tid=441293

Now, it seems to work perfectly fine ... just not for callbacks that have a string as a parameter. I'm getting the following error:

Код:
error 029: invalid expression, assumed zero
Code that's working fine:

pawn Код:
public OnPlayerConnect(playerid) {
    // My code here ...
   
    #if defined my_OnPlayerConnect
        my_OnPlayerConnect(playerid);
    #endif
    return 1;
}

#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
#else
    #define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect my_OnPlayerConnect
#if defined my_OnPlayerConnect
    forward my_OnPlayerConnect(playerid);
#endif
Code that's not working due to having a string as a parameter:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    // My code here...

    #if defined my_OnDialogResponse
        my_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
    #endif
    return 1;
}

#if defined _ALS_OnDialogResponse
    #undef OnDialogResponse
#else
    #define _ALS_OnDialogResponse
#endif
#define OnDialogResponse my_OnDialogResponse
#if defined my_OnDialogResponse
    forward my_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
#endif
Reply
#2

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    // My code here...

    #if defined my_OnDialogResponse
        my_OnDialogResponse(playerid, dialogid, response, listitem, inputtext); // remove []
    #endif
    return 1;
}

#if defined _ALS_OnDialogResponse
    #undef OnDialogResponse
#else
    #define _ALS_OnDialogResponse
#endif
#define OnDialogResponse my_OnDialogResponse
#if defined my_OnDialogResponse
    forward my_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
#endif
Reply
#3

Oh ... true, now pretty obvious. I'm passing a string, not accepting one. Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)