20.09.2011, 16:51
If you would use the stored dialogid instead of the passed value, it can be used for anti-dialog hack aswell:
also returning 0 in the callback is assumed in an include like this - you can pass the dialog to other scripts aswell:
also, a friendly idea: if you use PVar (which is slower than static variable) for storing dialog ID, the script will be cross compatible, e.g. in FilterScript1 there is a ShowPlayerDialog with id 1435, you can use GetPlayerDialog in FilterScript2 or in GameMode and it will return 1435.
BTW, good idea.
Edit: also you're doing it wrong with CallLocalFunction. You only pass the first 3 integers, change "iii" to "iiiis".
pawn Код:
public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{
new GPD_retval=(GPD_ODR)?CallLocalFunction("GPD_OnDialogResponse","iii",playerid,GPD_pdialog[playerid],response,listitem,inputtext):0;
GPD_pdialog[playerid]=-1;
return GPD_retval;
}
Quote:
Returning 0 in this callback will pass the dialog to another script in case no matching code were found in your gamemode's callback. |
BTW, good idea.
Edit: also you're doing it wrong with CallLocalFunction. You only pass the first 3 integers, change "iii" to "iiiis".