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

 

CamxxCore is there a way of not showing the notification saying that the contact does not exist?

 

Yes, I was wondering the same, plan on using this for adding a contact in my upcoming mod but it's really buggy at the moment.

I'll fix the issue with the "contact is no longer available" message thing. What other problems are you having?

Share this post


Link to post
Share on other sites
Konijima

 

 

CamxxCore is there a way of not showing the notification saying that the contact does not exist?

Yes, I was wondering the same, plan on using this for adding a contact in my upcoming mod but it's really buggy at the moment.

I'll fix the issue with the "contact is no longer available" message thing. What other problems are you having?

 

 

Is there any way of setting the index of a contact automaticly as the last item?

Share this post


Link to post
Share on other sites
CamxxCore

Digging up a pretty old thread but I updated my c# helper for the in- game phone

 

https://github.com/CamxxCore/iFruitAddon/releases

 

From release notes:

  • Added native in- call UI when calling contacts
  • Added an event handler for when the call is answered
  • You can change the text header and color of the soft key buttons
  • Contacts can be set to active or busy
  • Eliminated some lag in the Update() method
  • Other fixes
Edited by CamxxCore

Share this post


Link to post
Share on other sites
jedijosh920

Very nice update! I hope to find use of this in my future mods, it's awesome. :) Thanks for update man.

Share this post


Link to post
Share on other sites
gtaVmod

 

Digging up a pretty old thread but I updated my c# helper for the in- game phone

 

https://github.com/CamxxCore/iFruitAddon/releases

 

From release notes:

  • Added native in- call UI when calling contacts
  • Added an event handler for when the call is answered
  • You can change the text header and color of the soft key buttons
  • Contacts can be set to active or busy
  • Eliminated some lag in the Update() method
  • Other fixes

 

 

Any chance you summarize all natives used for the phone in one HOWTO?

Share this post


Link to post
Share on other sites
CamxxCore

Here is most of the functions with a bit of info on how they are used. Most of them have to be called every time the phone is brought up.

int GET_CURRENT_SELECTION() - returns index of the currently selected itemvoid SET_INPUT_EVENT(int direction) - simulates player input in the phone interface. 1 = up, 2 = right, 3 = down, 4 = leftvoid DISPLAY_VIEW(int viewID, int currentID) - switches the view in the phone interfacevoid SET_DATA_SLOT(int viewID, int index) - set the item  for the current viewvoid SET_SIGNAL_STRENGTH(int signal) - sets signal strength in the title bar (1 - 5)void SET_PROVIDER_ICON(int icon, int signalStrength)void SET_SLEEP_MODE(bool isSleepModeActive) - sets the phone to sleep modevoid SET_HEADER(string newHeader) - sets the header in the title barvoid SET_THEME(int themeID) - sets ui theme.void SET_SOFT_KEYS_COLOUR(int buttonID, byte R, byte G, byte B) - sets color of the soft keys by index (1 - 3)void SET_SOFT_KEYS(int buttonID, bool isVisible, int iconEnum) - sets icon of the soft keys by index (1 - 3)void SET_TITLEBAR_TIME(int newHour, int newMinute, int newDay) - sets title bar timevoid LOAD_APP(string whichMC) - loads an app by its name. known possibilities: "APP_*"void ADD_TXD_REF_RESPONSE(string textureDict, string uniqueID, bool success)void REQUEST_REMOVE_APP(string whichMC) - known possibilities: "APP_*" void SHUTDOWN_MOVIE()
Edited by CamxxCore

Share this post


Link to post
Share on other sites
gtaVmod

There is no SET_SIGNAL_STRENGTH, SET_PROVIDER_ICON, SET_SLEEP_MODE (maybe more) currently in DB, what's its hash value?

Edited by gtaVmod

Share this post


Link to post
Share on other sites
CamxxCore

There is no SET_SIGNAL_STRENGTH, SET_PROVIDER_ICON, SET_SLEEP_MODE (maybe more) currently in DB, what's its hash value?

Forgive me. These aren't natives, they are scaleform functions to be used with POP_SCALEFORM_MOVIE_FUNCTION_VOID, PUSH_SCALEFORM_MOVIE_PARAMETER etc.

 

As far as natives go, there isn't really much that is actually useful for the phone.

Edited by CamxxCore

Share this post


Link to post
Share on other sites
Prof_Farnsworth

 

Digging up a pretty old thread but I updated my c# helper for the in- game phone

 

https://github.com/CamxxCore/iFruitAddon/releases

 

From release notes:

  • Added native in- call UI when calling contacts
  • Added an event handler for when the call is answered
  • You can change the text header and color of the soft key buttons
  • Contacts can be set to active or busy
  • Eliminated some lag in the Update() method
  • Other fixes

 

 

Firstly, let me say this thing is great. I have been using it for my assassinations contacts for a while now. If I get the update, would I need to change anything in the existing code? It works well now ( with the older version), is it worth updating in your opinion? Also, do you mind if I distribute this with my mod, as it will be a requirement to use it? All proper credit and links will be given of course.

 

Thanks for some great work!

Edited by Prof_Farnsworth

Share this post


Link to post
Share on other sites
FlushingLocal

I was wondering this as well. I am currently using the old version as well, so do I need to update anything in my code or is it all in the new iFruitContacts.dll? Is it worth upgrading? Is that "The Selected Contact is no longer available" bug fixed?

Share this post


Link to post
Share on other sites
CamxxCore

 

 

Digging up a pretty old thread but I updated my c# helper for the in- game phone

 

https://github.com/CamxxCore/iFruitAddon/releases

 

From release notes:

  • Added native in- call UI when calling contacts
  • Added an event handler for when the call is answered
  • You can change the text header and color of the soft key buttons
  • Contacts can be set to active or busy
  • Eliminated some lag in the Update() method
  • Other fixes

 

 

Firstly, let me say this thing is great. I have been using it for my assassinations contacts for a while now. If I get the update, would I need to change anything in the existing code? It works well now ( with the older version), is it worth updating in your opinion? Also, do you mind if I distribute this with my mod, as it will be a requirement to use it? All proper credit and links will be given of course.

 

Thanks for some great work!

 

 

 

I was wondering this as well. I am currently using the old version as well, so do I need to update anything in my code or is it all in the new iFruitContacts.dll? Is it worth upgrading? Is that "The Selected Contact is no longer available" bug fixed?

 

I'm glad people are finding some use for this (: The biggest reason you might want to update is because i've improved some code that may have been causing some FPS lag for some people. The selected index is now being checked when an item is selected while previously I was checking it on every tick, which could have impacted performance on some machines. I also eliminated some delays caused by a call to Script.Wait() which could have caused some flicker for other UI items if it was ran in the same script.

 

As far as the "this contact is no longer available." message. I feel like i've tried everything. If someone has a suggestion for how I could disable the control actions in the phone, maybe we could solve this. Disabling the select control for the phone does nothing.

Share this post


Link to post
Share on other sites
FlushingLocal

So do we need to update our scripts or does the new iFruitContacts.dll include everything we need?

Share this post


Link to post
Share on other sites
CamxxCore

So do we need to update our scripts or does the new iFruitContacts.dll include everything we need?

 

It will break compatibility with the first version. Some things were moved around and its structured a bit differently.

Share this post


Link to post
Share on other sites
FlushingLocal

To be honest, I don't like the new updates because whenever you call a contact, the phone dosen't come back up (you can still hear the sounds) and you have to exit by clicking the left mouse button when in the first version, the phone would come immediately back up. Another thing is the ringing, it's driving me nuts, whenever I call a new contact for a blackout, the sounds of the phone will keep ringing until the blackout is over. Is there anyway you can fix this?

Share this post


Link to post
Share on other sites
CamxxCore

To be honest, I don't like the new updates because whenever you call a contact, the phone dosen't come back up (you can still hear the sounds) and you have to exit by clicking the left mouse button when in the first version, the phone would come immediately back up. Another thing is the ringing, it's driving me nuts, whenever I call a new contact for a blackout, the sounds of the phone will keep ringing until the blackout is over. Is there anyway you can fix this?

 

I'm not sure I know what you mean about the phone "coming back up". You mean the character was bringing the phone back up to his ear? Cause that was never something I added, even in the latest version. You can stop the phone ringing by setting the DialTimeout property on the contact to 0. It will immediately fire the answered event.

Share this post


Link to post
Share on other sites
FlushingLocal

No, I meant the phone reappears after the call. I've tried setting the DialTimeout to 0, but the ringing continues until the script is over (which in my case is 40000 ticks).

Share this post


Link to post
Share on other sites
jedijosh920

^ Yeah I actually encountered that with the latest versions, the front end sound of the phone ringing doesn't stop and continues forever at occasions, very annoying, and I have to reload/restart the game to fix.

Share this post


Link to post
Share on other sites
FlushingLocal

^Yep, it's annoying. (No offense Camxx)

Share this post


Link to post
Share on other sites
CamxxCore

^Yep, it's annoying. (No offense Camxx)

 

Yeah its my mistake. Sounds pretty annoying. I'll fix whatever that is right now.

 

edit: fixed it

Edited by CamxxCore

Share this post


Link to post
Share on other sites
FlushingLocal

Already? Dam that was quick.

Share this post


Link to post
Share on other sites
FlushingLocal

Thanks Camxx, this particular mod is the reason why all my great mods exist today! :D

 

And I just looked at the code, Jesus Christ I need to update everything in the old script to match the new addon. I think for now I'll release my update for my mod with the old iFruitContacts and then update the script with the new one and release it as a hot fix.

Share this post


Link to post
Share on other sites
Prof_Farnsworth

 

 

 

Digging up a pretty old thread but I updated my c# helper for the in- game phone

 

https://github.com/CamxxCore/iFruitAddon/releases

 

From release notes:

  • Added native in- call UI when calling contacts
  • Added an event handler for when the call is answered
  • You can change the text header and color of the soft key buttons
  • Contacts can be set to active or busy
  • Eliminated some lag in the Update() method
  • Other fixes

 

 

Firstly, let me say this thing is great. I have been using it for my assassinations contacts for a while now. If I get the update, would I need to change anything in the existing code? It works well now ( with the older version), is it worth updating in your opinion? Also, do you mind if I distribute this with my mod, as it will be a requirement to use it? All proper credit and links will be given of course.

 

Thanks for some great work!

 

 

 

I was wondering this as well. I am currently using the old version as well, so do I need to update anything in my code or is it all in the new iFruitContacts.dll? Is it worth upgrading? Is that "The Selected Contact is no longer available" bug fixed?

 

I'm glad people are finding some use for this (: The biggest reason you might want to update is because i've improved some code that may have been causing some FPS lag for some people. The selected index is now being checked when an item is selected while previously I was checking it on every tick, which could have impacted performance on some machines. I also eliminated some delays caused by a call to Script.Wait() which could have caused some flicker for other UI items if it was ran in the same script.

 

As far as the "this contact is no longer available." message. I feel like i've tried everything. If someone has a suggestion for how I could disable the control actions in the phone, maybe we could solve this. Disabling the select control for the phone does nothing.

 

 

I am having a constructor error and I am sure it is something simple I am missing. Can anyone see an issue that I can't with regards to the following code?

var contact = new iFruitContact("Bid for Contract", 20)contact.Answered += (s) => contractStart();contact.Icon = ContactIcon.Blocked;contact.DialTimeout = 3000;contracts.Contacts.Add(contact);contact = new iFruitContact("Call for Backup", 21);contact.Answered += (s) => bodyguardStart();contact.Icon = ContactIcon.Emergency;contact.DialTimeout = 3000;contracts.Contacts.Add(contact);

Any help is appreciated.

 

Prof

Share this post


Link to post
Share on other sites
gtaVmod

Here is most of the functions with a bit of info on how they are used. Most of them have to be called every time the phone is brought up.

 

Thanks but it is not clear how do you add contacts to the phone?

 

I'm really bad with C#, i noticed there is no Add() method (ifruit.Contacts.Add) in the sources so i guess it is supplied by default by language?

 

I want to understand not the C# code (i code in C++) but interactions with the engine to make basic functions: add contacts, call contacts...

Share this post


Link to post
Share on other sites
gtaVmod

looks like void Draw(int handle) is drawing contact(s) ?

Share this post


Link to post
Share on other sites
CamxxCore

 

 

 

 

Digging up a pretty old thread but I updated my c# helper for the in- game phone

 

https://github.com/CamxxCore/iFruitAddon/releases

 

From release notes:

  • Added native in- call UI when calling contacts
  • Added an event handler for when the call is answered
  • You can change the text header and color of the soft key buttons
  • Contacts can be set to active or busy
  • Eliminated some lag in the Update() method
  • Other fixes

 

 

Firstly, let me say this thing is great. I have been using it for my assassinations contacts for a while now. If I get the update, would I need to change anything in the existing code? It works well now ( with the older version), is it worth updating in your opinion? Also, do you mind if I distribute this with my mod, as it will be a requirement to use it? All proper credit and links will be given of course.

 

Thanks for some great work!

 

 

 

I was wondering this as well. I am currently using the old version as well, so do I need to update anything in my code or is it all in the new iFruitContacts.dll? Is it worth upgrading? Is that "The Selected Contact is no longer available" bug fixed?

 

I'm glad people are finding some use for this (: The biggest reason you might want to update is because i've improved some code that may have been causing some FPS lag for some people. The selected index is now being checked when an item is selected while previously I was checking it on every tick, which could have impacted performance on some machines. I also eliminated some delays caused by a call to Script.Wait() which could have caused some flicker for other UI items if it was ran in the same script.

 

As far as the "this contact is no longer available." message. I feel like i've tried everything. If someone has a suggestion for how I could disable the control actions in the phone, maybe we could solve this. Disabling the select control for the phone does nothing.

 

 

I am having a constructor error and I am sure it is something simple I am missing. Can anyone see an issue that I can't with regards to the following code?

var contact = new iFruitContact("Bid for Contract", 20)contact.Answered += (s) => contractStart();contact.Icon = ContactIcon.Blocked;contact.DialTimeout = 3000;contracts.Contacts.Add(contact);contact = new iFruitContact("Call for Backup", 21);contact.Answered += (s) => bodyguardStart();contact.Icon = ContactIcon.Emergency;contact.DialTimeout = 3000;contracts.Contacts.Add(contact);

Any help is appreciated.

 

Prof

 

 

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

Share this post


Link to post
Share on other sites
CamxxCore

looks like void Draw(int handle) is drawing contact(s) ?

 

Yup. The Draw(int handle) method in iFruitContact.cs is where the magic happens.

 

internal void Draw(int handle){Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION, handle, "SET_DATA_SLOT");Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT, 2);

The index in the list where the contact is drawn -->

 Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT, Index);
Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT, 0);Function.Call(Hash._BEGIN_TEXT_COMPONENT, "STRING");

The name of the contact, displayed in the list -->

Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, Name);
Function.Call(Hash._END_TEXT_COMPONENT);

Adds a separator between the picture icon for the contact and the text field (Pretty sure on this. Either that or it sets up the container for the contact image)-->

Function.Call(Hash._BEGIN_TEXT_COMPONENT, "CELL_999");
Function.Call(Hash._END_TEXT_COMPONENT);Function.Call(Hash._BEGIN_TEXT_COMPONENT, "CELL_2000");

The string name of the texture dict that will be shown as the contact icon -->

Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, Icon.Name);
Function.Call(Hash._END_TEXT_COMPONENT);Function.Call(Hash._POP_SCALEFORM_MOVIE_FUNCTION_VOID);}
Edited by CamxxCore

Share this post


Link to post
Share on other sites
gtaVmod

so this is another, not game phone and it can't have a call to taxi for example?

Edited by gtaVmod

Share this post


Link to post
Share on other sites
CamxxCore

so this is another, not game phone and it can't have a call to taxi for example?

 

I don't know what you are saying, sorry.

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

Share this post


Link to post
Share on other sites
jedijosh920

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);            }        }
Edited by jedijosh920

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.