Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

CamxxCore

Adding contacts to iFruit (Research)

Recommended Posts

CamxxCore

 

~snip~

Prof

 

 

Did you solve this? What is the problem in the constructor?

 

 

It says "object reference not set to an instance of object". I have not solved it yet, but I assume it has something to do with

 

contact.Answered += (s) => contractStart();

 

I am not sure what the "(s)" is referring to here, but in the example script you use this to call one function. The error still occurs however when doing the same, i.e. commenting out one of the calls.

 

I will admit I am not well versed in this addon, but love the functionality.

 

Any advice?

 

Prof

 

 

The (s) is just refers to the "sender" parameter on the Answered event handler, which would be the contact that answered the call. Before you started adding contacts, did you instantiate the CustomiFruit class?

 

i.e.

ifruit = new CustomiFruit()

?

 

I have made a very good discovery in regards to this plugin, I figured out how to remove this annoying notification so you can use any index!

 

9aedaabde8e6a2e48aef55a6c7b1e8f3.png

 

I was studying how the notification handles worked and learned quickly that they increment by 1. So if I made one notification then another, the notification handle goes from 0 to 1 and so forth.

	    Function.Call(Hash._SET_NOTIFICATION_TEXT_ENTRY, "STRING");	    Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, "Temp");            int Temp = Function.Call<int>(Hash._DRAW_NOTIFICATION, false, 1);            Function.Call(Hash._REMOVE_NOTIFICATION, Temp);            Function.Call(Hash._REMOVE_NOTIFICATION, Temp - 1);

The function above will make a temporary notification so it can get the handle and then delete the previous notification and itself. To remove the annoying "contact is no longer available", just add it to your Answered event with a DialTimeout of 100 milliseconds.

 

I hope this helped anyone looking for a fix to that, and @CamxxCore if you can add to your next update it will be great so we can use any index on the phone and not overwrite existing important story line ones.

 

EDIT: You can also use this function I made to clear all notifications, which is easier and cleaner, but if you want to only remove that certain notification and maybe you have other notifications you want on the screen, then don't use this:

        public static void ClearAllNotifications()        {            for (int i = 0; i < 9999; i++)            {                Function.Call(Hash._REMOVE_NOTIFICATION, i);            }        }

 

Wow. Very nice! You are welcome to submit a pull request on github. Otherwise I will definatley add that when I get a chance

Share this post


Link to post
Share on other sites
Prof_Farnsworth

snip~

Prof

 

 

Did you solve this? What is the problem in the constructor?

 

 

It says "object reference not set to an instance of object". I have not solved it yet, but I assume it has something to do with

 

contact.Answered += (s) => contractStart();

 

I am not sure what the "(s)" is referring to here, but in the example script you use this to call one function. The error still occurs however when doing the same, i.e. commenting out one of the calls.

 

I will admit I am not well versed in this addon, but love the functionality.

 

Any advice?

 

Prof

 

 

The (s) is just refers to the "sender" parameter on the Answered event handler, which would be the contact that answered the call. Before you started adding contacts, did you instantiate the CustomiFruit class?

 

i.e.

ifruit = new CustomiFruit()

?

Wow, thank you. For some reason I was thinking I only needed that if I wanted to edit the buttons. It works great now!

Share this post


Link to post
Share on other sites
CamxxCore

The annoying problem with the "contact is no longer available" notification has now been resolved, thanks to a fix from jedijosh920. I've pushed a new version with the fix added so enjoy.

Share this post


Link to post
Share on other sites
wootwoots

just saw that, that's a really nice find ! i wish more mod use that to pop up the various menu instead of having to set a keys :D

that's way more immersive.

Great job :O

Share this post


Link to post
Share on other sites
stef538

Hi,

 

Is there any chance this could be updated to work with the latest version of scripthook/GTA ?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.