private void ContactAnswered(iFruitContact contact) { // The contact has answered, we can execute our code UI.Notify("The contact has answered."); // We need to close the phone at a moment. // We can close it as soon as the contact pick up calling _iFruit.Close(). // Here, we will close the phone in 5 seconds (5000ms). _iFruit.Close(5000); }
private void docAnswered(iFruitContact contact) { Random random = new Random(); int index = random.Next(Dialogue.docPositive.Count); string docResponse = Dialogue.docPositive[index]; newJobStartTick = Environment.TickCount + new Random().Next(NEW_JOB_MIN_TICKS, NEW_JOB_MAX_TICKS); _iFruit.Close(5000); currentSubtitle = "Doc: " + docResponse; subtitleEndTick = Environment.TickCount + 4000; }
private void setupPhone() { _iFruit = new CustomiFruit(); iFruitContact contactDoc = new iFruitContact("Doc"); contactDoc.Answered += docAnswered; contactDoc.DialTimeout = 4000; contactDoc.Active = true; contactDoc.Icon = ContactIcon.Blank; _iFruit.Contacts.Add(contactDoc); }
public iFruitHitman() { InitPhone(); name = "Middleman"; contact = new iFruitContact(name); id = contact.Index; contact.Answered += Contact_Answered; contact.DialTimeout = 8000; contact.Active = true; contact.Icon = new ContactIcon("char_hunter"); phone.Contacts.Add(contact); startMission = false; _mScriptHash = Function.Call <int>(Hash.GET_HASH_KEY, "cellphone_flashhand"); }
public void Contact_Answered(iFruitContact contact) { if (contact == this.contact) { this.startMission = !this.startMission; if (startMission) { Hitman.HitmanMission.hitmanNotify("Hey there, I got your call. Clients are always hungry !"); } else { Hitman.HitmanMission.hitmanNotify("Okay. Clients will have to go get their pizzas themselves, i guess..."); } phone.Close(); } }
/// <summary> /// Returns an iFruit contact ready to be added to the contact collection of a customiFruit. /// </summary> /// <returns>The phone contact.</returns> private iFruitContact GetiFruitContact() { string contactName = _file?.Element("Phone")?.Element("ContactName")?.Value ?? "Unknown"; ContactIcon = _file?.Element("Phone")?.Element("ContactIcon")?.Value ?? "CHAR_DEFAULT"; Bold = bool.Parse(_file?.Element("Phone")?.Element("Bold")?.Value ?? "False"); int dialTimeout = int.Parse(_file?.Element("Phone")?.Element("DialTimeout")?.Value ?? "0"); iFruitContact contact = new iFruitContact(contactName); contact.Bold = Bold; contact.Active = true; contact.DialTimeout = dialTimeout; contact.Icon = new ContactIcon(ContactIcon); return(contact); }
public ExampleScript() { ifruit = new CustomiFruit() { SelectButtonColor = System.Drawing.Color.Orange, ReturnButtonColor = System.Drawing.Color.LimeGreen, KeypadButtonColor = System.Drawing.Color.Purple }; var contact = new iFruitContact("Spawn Adder", 10); contact.Selected += (sender, args) => Scripts.SpawnVehicle("ADDER", Game.Player.Character.Position); ifruit.Contacts.Add(contact); contact = new iFruitContact("Teleport to Waypoint", 11); contact.Selected += (sender, args) => Scripts.TeleportToWaypoint(); ifruit.Contacts.Add(contact); this.Tick += OnTick; }
public ExampleScript() { ifruit = new CustomiFruit() { CenterButtonColor = System.Drawing.Color.Orange, LeftButtonColor = System.Drawing.Color.LimeGreen, RightButtonColor = System.Drawing.Color.Purple, CenterButtonIcon = SoftKeyIcon.Fire, LeftButtonIcon = SoftKeyIcon.Police, RightButtonIcon = SoftKeyIcon.Website }; ifruit.SetWallpaper(new Wallpaper("char_facebook")); //or.. ifruit.SetWallpaper(Wallpaper.BadgerDefault); var contact = new iFruitContact("Spawn Adder", 19); contact.Answered += Contact_Answered; contact.DialTimeout = 8000; contact.Active = true; //set custom icons by instantiating the ContactIcon class contact.Icon = new ContactIcon("char_sasquatch"); ifruit.Contacts.Add(contact); contact = new iFruitContact("Teleport to Waypoint", 20); contact.Answered += (s) => Scripts.TeleportToWaypoint(); contact.DialTimeout = 0; contact.Icon = ContactIcon.Target; ifruit.Contacts.Add(contact); Tick += OnTick; }
public ExampleScript() { // Custom phone creation _iFruit = new CustomiFruit(); // Phone customization (totally optional) /* * _iFruit.CenterButtonColor = System.Drawing.Color.Orange; * _iFruit.LeftButtonColor = System.Drawing.Color.LimeGreen; * _iFruit.RightButtonColor = System.Drawing.Color.Purple; * _iFruit.CenterButtonIcon = SoftKeyIcon.Fire; * _iFruit.LeftButtonIcon = SoftKeyIcon.Police; * _iFruit.RightButtonIcon = SoftKeyIcon.Website; */ // New contact (wait 4 seconds (4000ms) before picking up the phone) iFruitContact contactA = new iFruitContact("Test contact"); contactA.Answered += ContactAnswered; // Linking the Answered event with our function contactA.DialTimeout = 4000; // Delay before answering contactA.Active = true; // true = the contact is available and will answer the phone contactA.Icon = ContactIcon.Blank; // Contact's icon _iFruit.Contacts.Add(contactA); // Add the contact to the phone // New contact (wait 4 seconds before displaying "Busy...") iFruitContact contactB = new iFruitContact("Test contact 2"); contactB.DialTimeout = 4000; contactB.Active = false; // false = the contact is busy contactB.Icon = ContactIcon.Blocked; contactB.Bold = true; // Set the contact name in bold _iFruit.Contacts.Add(contactB); Tick += OnTick; }
private void Contact_Answered(iFruitContact contact) { Scripts.SpawnVehicle("ADDER"); UI.Notify("Your Adder has been delivered!"); }