SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 26/04/2014, 07:57 PM   #1
Campbell-
Big Clucker
 
Join Date: Jan 2012
Location: Germany
Posts: 140
Reputation: 12
Default Issue With ******'s Hooking When Having Strings as Parameter

I'm hooking my callbacks according to this method: http://forum.sa-mp.com/showthread.php?t=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:

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

pawn Code:
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 Code:
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
Campbell- is offline   Reply With Quote
Old 26/04/2014, 08:03 PM   #2
iZN
High-roller
 
Join Date: Jun 2010
Posts: 2,369
Reputation: 569
Default Re: Issue With ******'s Hooking When Having Strings as Parameter

pawn Code:
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
iZN is offline   Reply With Quote
Old 26/04/2014, 08:04 PM   #3
Campbell-
Big Clucker
 
Join Date: Jan 2012
Location: Germany
Posts: 140
Reputation: 12
Default Re: Issue With ******'s Hooking When Having Strings as Parameter

Oh ... true, now pretty obvious. I'm passing a string, not accepting one. Thanks!
Campbell- is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hooking (ALS) CreativityLacker Scripting Help 9 02/06/2013 04:49 PM
Hooking! gert232 Scripting Help 4 22/08/2012 08:07 PM
Issue with SetPlayerHealth to parameter (y_commands) LeonRedfield Scripting Help 6 28/05/2012 09:37 AM
Hooking OnPlayerClickPlayerTextDraw SuperViper Scripting Help 1 05/05/2012 06:08 PM
Sscanf Issue [Format specifier does not match parameter count] Jack_Wilson Scripting Help 1 05/03/2012 07:35 AM


All times are GMT. The time now is 11:14 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.