CamxxCore / iFruitAddon

GTA V ScriptHookVDotNet extension allowing customization of the in- game mobile phone
MIT License
20 stars 10 forks source link

Example script unclear #3

Closed RainerHilmer closed 8 years ago

RainerHilmer commented 8 years ago

Hi, it's me again. :) I look at your example script and I don't quite understand what's the difference between the Selected event and the Answered event. In your example you attached the Contact_Answered method to the Answered event and that method has an iFruitContact parameter but that's not used in any way. This method just wraps another method (SpawnVehicle) and calls UI.Notify, which could also be in SpawnVehicle.

CamxxCore commented 8 years ago

Most methods have some sort of documentation if you go through the source. The example with the Answered event just defines the event handler with its parameters. The ifruitcontact passed to that method is the contact that answered the call. You could just as easily use lambda if you don't need to worry about the parameters.

RainerHilmer commented 8 years ago

So in a nutshell I only use the Answered event if I want to do any further actions on the contact, right? Thank you.

CamxxCore commented 8 years ago

Ya the selected event should probably be deprecated now seeing as the same effect can be achieved using the Answered event and setting DialTimeout = 0. I can see how that might have been confusing.