SA-MP Forums Archive
How to make an include? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to make an include? (/showthread.php?tid=307455)



How to make an include? - Zcelo12 - 30.12.2011

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


Re: How to make an include? - Ash. - 30.12.2011

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


AW: How to make an include? - Zcelo12 - 30.12.2011

Nope, only in the include...


Re: AW: How to make an include? - Ash. - 30.12.2011

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...
}



AW: How to make an include? - Zcelo12 - 30.12.2011

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[]);



Re: How to make an include? - Ash. - 30.12.2011

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[]);



Re: How to make an include? - Guest9328472398472 - 30.12.2011

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


Re: How to make an include? - Ash. - 30.12.2011

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