[Include] B-Dial - Fast Dialog Response Processor
#14

For real...
I'll explain you the logic behind this

OnDialogResponse already exists in this script, so I don't have to check for its validity.
  • IF any "dial_" callbacks doesnt't exists or returns 0 so Dial_OnDialogResponse will be called
  • IF the Dial_OnDialogResponse exists and it returns 1, this callback won't get called in another scripts.
  • IF Dial_OnDialogResponse doesn't exists, funcidx will return -1 and our callback is missing. returns zero also and will be called in another scripts to keep checking for any dialog response.
  • Same for if Dial_OnDialogResponse exists and it returns simply 0, then it will be ofc called (same as above) in another scripts
In your methode it doesn't really check the availability of the new function so if Dial_OnDialogResponse doesn't exists, funcidx will not return -1 because in the include there is already OnDialogResponse and while doing the check for its availability it will just return 0 (Oh imagine you are doing it for OnPlayerUpdate)

Edit:
Quote:
Originally Posted by wups
Посмотреть сообщение
Edit: Oh i didn't notice you have (DIAL_ODR != -1) there.
Anyway I think a better way to do it would save it in a boolean.
pawn Код:
new bool:DIAL_ODR;
DIAL_ODR = (funcidx(...) != -1);
* BigETI kisses on your forehead
This will indeed make the check faster!
Reply


Messages In This Thread
B-Dial - Fast Dialog Response Processor - by BigETI - 04.11.2011, 01:07
Re: B-Dial - Fast Dialog Response Processor - by Norn - 04.11.2011, 02:24
Re: B-Dial - Fast Dialog Response Processor - by System64 - 04.11.2011, 07:40
Re: B-Dial - Fast Dialog Response Processor - by EvgeN 1137 - 04.11.2011, 07:50
Re: B-Dial - Fast Dialog Response Processor - by vampirmd - 04.11.2011, 08:19
AW: B-Dial - Fast Dialog Response Processor - by BigETI - 04.11.2011, 08:57
Re: B-Dial - Fast Dialog Response Processor - by juraska - 04.11.2011, 09:35
Re: B-Dial - Fast Dialog Response Processor - by [LaTinb0y]...$ag3R - 04.11.2011, 09:35
Re: B-Dial - Fast Dialog Response Processor - by wups - 04.11.2011, 10:32
AW: Re: B-Dial - Fast Dialog Response Processor - by BigETI - 04.11.2011, 10:37
Re: AW: Re: B-Dial - Fast Dialog Response Processor - by wups - 04.11.2011, 10:41
B-Dial - Fast Dialog Response Processor - by BigETI - 04.11.2011, 10:56
Re: B-Dial - Fast Dialog Response Processor - by wups - 04.11.2011, 10:59
AW: B-Dial - Fast Dialog Response Processor - by BigETI - 04.11.2011, 11:12
Re: B-Dial - Fast Dialog Response Processor - by Gamer_Z - 04.11.2011, 11:35
Re: B-Dial - Fast Dialog Response Processor - by BaubaS - 04.11.2011, 11:42
Re: B-Dial - Fast Dialog Response Processor - by TheArcher - 04.11.2011, 12:53
Re: B-Dial - Fast Dialog Response Processor - by Jochemd - 04.11.2011, 14:26
AW: Re: B-Dial - Fast Dialog Response Processor - by BigETI - 04.11.2011, 14:59
Re: B-Dial - Fast Dialog Response Processor - by iGear Track - 04.11.2011, 15:02
AW: B-Dial - Fast Dialog Response Processor - by BigETI - 04.11.2011, 16:38
Re: B-Dial - Fast Dialog Response Processor - by wups - 04.11.2011, 17:37
Re: B-Dial - Fast Dialog Response Processor - by Gamer_Z - 05.11.2011, 13:01
B-Dial - Fast Dialog Response Processor - by BigETI - 05.11.2011, 16:24
Re: B-Dial - Fast Dialog Response Processor - by Lookin - 05.11.2011, 17:27
Re: B-Dial - Fast Dialog Response Processor - by Gamer_Z - 05.11.2011, 17:28
Re: B-Dial - Fast Dialog Response Processor - by Anthony © - 15.10.2012, 20:56
Re: B-Dial - Fast Dialog Response Processor - by jpeg - 15.10.2012, 21:38

Forum Jump:


Users browsing this thread: 3 Guest(s)