Returning in Filterscripts.
#1

What is the issue with returning of callbacks in filterscripts?

I'm using OnPlayerSpawn, OnPlayerConnect/Disconnect, and OnPlayerEditObject, what do I return to avoid bugs.

I've read you have to return 0, or the callback in the main mode doesn't get called.
Reply
#2

I think only onplayercommand handles the return value, but im not sure
Reply
#3

Also if you return 1 at the end of OnDialogResponse in your gamemode/filterscript when no dialogids have been found, your filterscripts dialogs will bug (any filterscript that is loaded after the one that returns 1).

It's fine to return 1 if a dialog is found.

EG how it should be (without response code to keep it short),

pawn Код:
#define SOME_DIALOG_ID      1

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

    switch(dialogid)
    {
        case SOME_DIALOG_ID:
        {
            //dialog found return 1
            return 1;
        }
    }

    //no dialogs found return 0
    return 0;
}
This is why some people report dialogs not working. When they respond to a dialog and it does nothing but close it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)