How to make an include?
#1

Hey all,
I'm workin on an include at the moment and have a problem.
In this include I'm using OnDialogResponse. So i put this under the callback
in the include:
Код:
#if defined _ALS_OnDialogResponse
    #undef OnDialogResponse
#else
    #define _ALS_OnDialogResponse
#endif
#define OnDialogResponse achievements_OnDialogResponse
forward achievements_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
But this is buggy with OnDialogResponse in my Main-Script. Some functions don't work then.
If i don't include my Include , everything works perfect.

Can anyone help me?
Greetings
Reply
#2

Are you calling "achievements_OnDialogResponse" in the OnDialogResponse callback in your filterscript?
Reply
#3

Nope, only in the include...
Reply
#4

Quote:
Originally Posted by Zcelo12
Посмотреть сообщение
Nope, only in the include...
Are you actually using the OnDialogResponse callback in the include? If so, are you calling "achievements_OnDialogResponse" within it?

pawn Код:
public OnDialogResponse(...)
{
     //Code...
     achievements_OnDialogResponse(...);
     //return...
}
Reply
#5

No, i actually using this:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	    if(dialogid == DIALOG_ERFOLGE && response)
	    {
	    if(listitem == 0)
	    {
	    new textd[35],str2[10];
	    if(PlayerLanguage[playerid] == 0)
	    {
	    format(str2,sizeof(str2),"%s",Achievements[listitem][Title]);
	    format(textd,sizeof(textd),"%s",Achievements[listitem][Named]);
	    ShowPlayerDialog(playerid,DIALOG_ERFOLGE2,DIALOG_STYLE_MSGBOX,str2,textd,"Ok","");
	    }
	    else
	    {
	    format(textd,sizeof(textd),"%s",Achievements[listitem][NameE]);
	    format(str2,sizeof(str2),"%s",Achievements[listitem][Title]);
	    ShowPlayerDialog(playerid,DIALOG_ERFOLGE2,DIALOG_STYLE_MSGBOX,str2,textd,"Ok","");
	    }
	    }
	    return 1;
	    }
	    return 0;
}
#if defined _ALS_OnDialogResponse
    #undef OnDialogResponse
#else
    #define _ALS_OnDialogResponse
#endif
#define OnDialogResponse achievements_OnDialogResponse
forward achievements_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
Reply
#6

You need to call achievements_OnDialogResponse in the callback too. Like so:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        if(dialogid == DIALOG_ERFOLGE && response)
        {
            if(listitem == 0)
            {
                new textd[35],str2[10];
                if(PlayerLanguage[playerid] == 0)
                {
                    format(str2,sizeof(str2),"%s",Achievements[listitem][Title]);
                    format(textd,sizeof(textd),"%s",Achievements[listitem][Named]);
                    ShowPlayerDialog(playerid,DIALOG_ERFOLGE2,DIALOG_STYLE_MSGBOX,str2,textd,"Ok","");
                }
                else
                {
                    format(textd,sizeof(textd),"%s",Achievements[listitem][NameE]);
                    format(str2,sizeof(str2),"%s",Achievements[listitem][Title]);
                    ShowPlayerDialog(playerid,DIALOG_ERFOLGE2,DIALOG_STYLE_MSGBOX,str2,textd,"Ok","");
                }
            }
        return 1;
        }
        achievements_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
        return 0;
}
#if defined _ALS_OnDialogResponse
    #undef OnDialogResponse
#else
    #define _ALS_OnDialogResponse
#endif
#define OnDialogResponse achievements_OnDialogResponse
forward achievements_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
Reply
#7

https://sampforum.blast.hk/showthread.php?tid=261570
Reply
#8

Quote:
Originally Posted by Brandon Javorsky
Посмотреть сообщение
That link is related to plugins, not includes.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)