about hooking speed..
#1

as a modular programmer, I use hook erverywhere, but something still confused me. speed.
before use a hook, my callback just like this:

Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
	switch(dialogid) {
		case DIALOG_ID_A : return RE_DIALOG_A(playerid, response, listitem, inputtext);
		case DIALOG_ID_B : return RE_DIALOG_B(playerid, response, listitem, inputtext);
		case DIALOG_ID_C : return RE_DIALOG_C(playerid, response, listitem, inputtext);
		case DIALOG_ID_D : return RE_DIALOG_D(playerid, response, listitem, inputtext);
		case DIALOG_ID_E : return RE_DIALOG_E(playerid, response, listitem, inputtext);
		case DIALOG_ID_F : return RE_DIALOG_F(playerid, response, listitem, inputtext);
	}
	return 1;
}
if player response a dialog, the callback match one condition and return.
now, we use hook and it will run every hook callback.
if I hooked 100 times of this callback, it will just loop 100 times.

so, I cant think a method to resolve this problem.
how you guys code with hook?
plz tell me a proper way.
Reply


Messages In This Thread
about hooking speed.. - by iLuXing - 06.03.2016, 12:52
Re: about hooking speed.. - by Hiddos - 17.03.2016, 16:27

Forum Jump:


Users browsing this thread: 1 Guest(s)