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

update: Download .NET wrapper to very easily implement this in your script!

p6GdzYL.pngr1mmeL4.pngy5LMits.png

After going through the rockstar scripts, I figured out how contact are added into the phone:

void AddPhoneContact(char* text){	//request ifruit handle	int scaleForm = GRAPHICS::REQUEST_SCALEFORM_MOVIE("cellphone_ifruit");	//push function to the stack to change the data	GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(scaleForm, "SET_DATA_SLOT");	//not sure	GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_FLOAT((float) 2);	//set data slot index	GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_FLOAT((float) num);	//not sure	GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_FLOAT(0.0f);	GRAPHICS::_BEGIN_TEXT_COMPONENT("STRING");	//add our text	UI::_ADD_TEXT_COMPONENT_STRING(text);	GRAPHICS::_END_TEXT_COMPONENT();	GRAPHICS::_BEGIN_TEXT_COMPONENT("CELL_MP_999");	GRAPHICS::_END_TEXT_COMPONENT();	GRAPHICS::_BEGIN_TEXT_COMPONENT("CELL_MP_999");	GRAPHICS::_END_TEXT_COMPONENT();	//pop and call on the stack	GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();	//increment index for next item	num += 1; }//call when user opens ifruit/ contacts app

To get the selected item, call this on each tick:

	GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(scaleForm, "GET_CURRENT_SELECTION");	int result = GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION();	while (!GRAPHICS::_0x768FF8961BA904D6(result))		WAIT(0);	int data = GRAPHICS::_0x2DE7EFA66B906036(result);

data will contain the current selected index

Edited by CamxxCore

Share this post


Link to post
Share on other sites
ChOcOsKiZo

Nice find :)

Share this post


Link to post
Share on other sites
Konijima

Wow man, that's awesome.

Thanks for the .NET adaptation too that's a great job.

 

That can be so much of a use!

Share this post


Link to post
Share on other sites
CamxxCore

Wow man, that's awesome.

Thanks for the .NET adaptation too that's a great job.

 

That can be so much of a use!

No problem (: I'm going to see what other things can be done with the phone. There is a lot of potential for some cool script mods using the scale form movies

Share this post


Link to post
Share on other sites
TuckerW2001

Doesnt work for me, What exactly is num?

Share this post


Link to post
Share on other sites
DaBOSS54320

I always thought it would be cool if in that 9th spot we/modders added some type of menu there.

Share this post


Link to post
Share on other sites
CamxxCore

Doesnt work for me, What exactly is num?

 

num is the just the data being returned from the GET_CURRENT_SELECTION function. What it actually returns I dont know. From the looks of it it may just be an integer representing something to do with the state of the phone UI. It doesn't actually return the index until _0x768FF8961BA904D6 returns true which maybe just checks if we can return the selected index on the current tick. Just speculation, but its probably something like that..

Edited by CamxxCore

Share this post


Link to post
Share on other sites
TuckerW2001

How hard would it be to get this working for a file in Visual Studio because i tried? It didnt work at all it either gave errors in the code, or crashed the game? If you can please assist me Skype - TuckerW2001

Share this post


Link to post
Share on other sites
Jax765

On the topic of contacts, is there a way to remove them? For some reason the game never removes dead or unused contacts at any point, unlike GTA IV.

Share this post


Link to post
Share on other sites
CamxxCore

How hard would it be to get this working for a file in Visual Studio because i tried? It didnt work at all it either gave errors in the code, or crashed the game? If you can please assist me Skype - TuckerW2001

Use the .NET dll provided at the top of the post. You just need to reference it in your project. Look at the example script on github for an example of how to use it

Share this post


Link to post
Share on other sites
CamxxCore

On the topic of contacts, is there a way to remove them? For some reason the game never removes dead or unused contacts at any point, unlike GTA IV.

There is a function called "CLEAR_DATA_SLOT" that will do that. It's probably used in a similar way to SET_DATA_SLOT. It would have to be called each time you bring up the contacts app.

Share this post


Link to post
Share on other sites
TuckerW2001

I mean a C++ mod how would i do this?

Share this post


Link to post
Share on other sites
GeorgeZhang

this is so freaking awesome I just implemented it and it works like a dream !!!! thanks a lot !

also is there a way I can make the player hang up the phone automatically ?

Share this post


Link to post
Share on other sites
CamxxCore

this is so freaking awesome I just implemented it and it works like a dream !!!! thanks a lot !

also is there a way I can make the player hang up the phone automatically ?

 

If theres a will, theres a way :] I have seen a few natives that look to have something to do with setting up phone conversations. It would definitely be something to look in to. Something I was thinking about adding was making it so you could setup the dialogue for a phone call and have the contact "answer" and give details about a mission or something. I'll have to look through the scripts again and see what I can find

Share this post


Link to post
Share on other sites
GeorgeZhang

 

this is so freaking awesome I just implemented it and it works like a dream !!!! thanks a lot !

also is there a way I can make the player hang up the phone automatically ?

 

If theres a will, theres a way :] I have seen a few natives that look to have something to do with setting up phone conversations. It would definitely be something to look in to. Something I was thinking about adding was making it so you could setup the dialogue for a phone call and have the contact "answer" and give details about a mission or something. I'll have to look through the scripts again and see what I can find

 

ok man, please keep up the good work:) looking forward to that "conversation"!

 

EDIT: is there a way to get the player's current contacts numbers, so that I can add the new contact at the button of the "contacts" ?

Edited by GeorgeZhang

Share this post


Link to post
Share on other sites
CamxxCore

 

 

this is so freaking awesome I just implemented it and it works like a dream !!!! thanks a lot !

also is there a way I can make the player hang up the phone automatically ?

If theres a will, theres a way :] I have seen a few natives that look to have something to do with setting up phone conversations. It would definitely be something to look in to. Something I was thinking about adding was making it so you could setup the dialogue for a phone call and have the contact "answer" and give details about a mission or something. I'll have to look through the scripts again and see what I can find

 

ok man, please keep up the good work:) looking forward to that "conversation"!

 

EDIT: is there a way to get the player's current contacts numbers, so that I can add the new contact at the button of the "contacts" ?

Didn't have any luck finding something like that. :[ Otherwise I would have just eliminated the whole index thing and added the contacts after the last item. I know the contacts change depending on the players progression so it wouldn't make much sense to have a static number of contacts for each character. I'll have to see if there is a way or maybe a funky workaround that will let us find the number of items in the list.

Share this post


Link to post
Share on other sites
jedijosh920

Nicely done, maybe add a way to set the picture of the contact, remove the contact, call the contact, use a different font rather than the bold mp one, or open into a new page with more options? Also, I encountered a little bug when I select the contact at times it would change to one of my online friend's contacts and it would ask me to call them and also the 9th index would say it is no longer available. Thanks, will definitely use this in the future.

Edited by jedijosh920

Share this post


Link to post
Share on other sites
Prof_Farnsworth

This is awesome. That is all.

 

Thanks for sharing your work Cam!

Edited by Prof_Farnsworth

Share this post


Link to post
Share on other sites
GeorgeZhang

 

 

 

this is so freaking awesome I just implemented it and it works like a dream !!!! thanks a lot !

also is there a way I can make the player hang up the phone automatically ?

If theres a will, theres a way :] I have seen a few natives that look to have something to do with setting up phone conversations. It would definitely be something to look in to. Something I was thinking about adding was making it so you could setup the dialogue for a phone call and have the contact "answer" and give details about a mission or something. I'll have to look through the scripts again and see what I can find

 

ok man, please keep up the good work:) looking forward to that "conversation"!

 

EDIT: is there a way to get the player's current contacts numbers, so that I can add the new contact at the button of the "contacts" ?

Didn't have any luck finding something like that. :[ Otherwise I would have just eliminated the whole index thing and added the contacts after the last item. I know the contacts change depending on the players progression so it wouldn't make much sense to have a static number of contacts for each character. I'll have to see if there is a way or maybe a funky workaround that will let us find the number of items in the list.

 

ok, i'll have to set it to 22 then(it works)

Share this post


Link to post
Share on other sites
CamxxCore

Nicely done, maybe add a way to set the picture of the contact, remove the contact, call the contact, use a different font rather than the bold mp one, or open into a new page with more options? Also, I encountered a little bug when I select the contact at times it would change to one of my online friend's contacts and it would ask me to call them and also the 9th index would say it is no longer available. Thanks, will definitely use this in the future.

Some nice suggestions :) I'll have to see what's possible. It would be pretty neat to implement a full menu system. I think a lot of people would appreciate using the phone menu for a trainer to avoid getting cluttered with keybinds

Share this post


Link to post
Share on other sites
Dec04

Can you please adaptate for lua?

Share this post


Link to post
Share on other sites
Neutrinobeam

Some testing.

 

The phone must be up and on the Contacts menu to be able to push new contacts to it. (Check the number of instances of the "appcontacts" script.)

 

The "data slot index" or num is the position of that contact in the list (starting at 0 and increasing downward. I didn't attempt to push contacts above the existing number so I don't know how it reacts to gaps in the list.

 

It will overwrite an existing contact, so multiple mods shouldn't push to the same index. (Finding a way to get the current number would be very useful.)

Share this post


Link to post
Share on other sites
CamxxCore

Some testing.

 

The phone must be up and on the Contacts menu to be able to push new contacts to it. (Check the number of instances of the "appcontacts" script.)

 

The "data slot index" or num is the position of that contact in the list (starting at 0 and increasing downward. I didn't attempt to push contacts above the existing number so I don't know how it reacts to gaps in the list.

 

It will overwrite an existing contact, so multiple mods shouldn't push to the same index. (Finding a way to get the current number would be very useful.)

The index for the items is reflected immediately after adding a new contact the list. ie: if you add a new contact at index #2, the collection is shifted right to accommodate the new item.

 

The reason we need to add the contacts after the app is already open is because the rockstar script is ran each time the app is opened. We need to add our items after the rockstar script has done its thing.

Share this post


Link to post
Share on other sites
Neutrinobeam

 

The index for the items is reflected immediately after adding a new contact the list. ie: if you add a new contact at index #2, the collection is shifted right to accommodate the new item.

 

The reason we need to add the contacts after the app is already open is because the rockstar script is ran each time the app is opened. We need to add our items after the rockstar script has done its thing.

 

 

Every time I've attempted the natives have overwritten the existing contacts, not shifted.

 

Write a small script that pushes "Z" to 1 and then "Y" to 0 when activated.

 

Note the contacts before, e.g. "A", "B", "C".

 

I've seen afterward "Y", "Z", "C".

 

Shifting would result in "Y", "A", "Z", "B", "C".

Share this post


Link to post
Share on other sites
GeorgeZhang

I've tried to call these functions after calling a custom contacts:

            Function.Call(Hash.DESTROY_MOBILE_PHONE);            Wait(1000);            if (model == Function.Call<int>(Hash.GET_HASH_KEY, "player_one"))                Function.Call(Hash.CREATE_MOBILE_PHONE, 2);            else if (model == Function.Call<int>(Hash.GET_HASH_KEY, "player_two"))                Function.Call(Hash.CREATE_MOBILE_PHONE, 1);            else                Function.Call(Hash.CREATE_MOBILE_PHONE, 0);

DESTROY_MOBILE_PHONE forces the player hangup the phone. If I don't create another phone afterward, you can never bring up the phone again, but if I do create it, it goes back to the same place it was, that is "Unknown.....BUSY" screen.

 

I tried this one as well but had no luck:

Function.Call(Hash.SCRIPT_IS_MOVING_MOBILE_PHONE_OFFSCREEN, true);

Any Ideas?

Edited by GeorgeZhang

Share this post


Link to post
Share on other sites
CamxxCore

 

The index for the items is reflected immediately after adding a new contact the list. ie: if you add a new contact at index #2, the collection is shifted right to accommodate the new item.

The reason we need to add the contacts after the app is already open is because the rockstar script is ran each time the app is opened. We need to add our items after the rockstar script has done its thing.

 

Every time I've attempted the natives have overwritten the existing contacts, not shifted.

 

Write a small script that pushes "Z" to 1 and then "Y" to 0 when activated.

 

Note the contacts before, e.g. "A", "B", "C".

 

I've seen afterward "Y", "Z", "C".

 

Shifting would result in "Y", "A", "Z", "B", "C".

Yeah it's doesn't shift. my mistake. I remembered it incorrectly.

 

For determining the amount of items in the list.. If there is a function that returns the name of the item, we could potentially cycle through the index and check for null or empty strings.

Edited by CamxxCore

Share this post


Link to post
Share on other sites
Neutrinobeam
Yeah it's doesn't shift. my mistake. I remembered it incorrectly.

 

For determining the amount of items in the list.. If there is a function that returns the name of the item, we could potentially cycle through the index and check for null or empty strings.

 

 

How do you propose cycling through the list without user interaction? Also, doesn't the contact list automatically wrap around?

Share this post


Link to post
Share on other sites
CamxxCore

 

Yeah it's doesn't shift. my mistake. I remembered it incorrectly.

 

For determining the amount of items in the list.. If there is a function that returns the name of the item, we could potentially cycle through the index and check for null or empty strings.

 

 

How do you propose cycling through the list without user interaction? Also, doesn't the contact list automatically wrap around?

 

 

Well since we can insert data slot items far past the last index of visible contacts, I would assume we can call functions on the data slots that haven't had a label assigned. Maybe not, i don't know.

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?

Edited by Konijima

Share this post


Link to post
Share on other sites
jedijosh920

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.

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.