Jump to content

GTA IV - How Do I Use Phone Numbers in Scripts (BindPhoneNumber)?


Recommended Posts

Hey everyone,

I just started getting into writing GTA IV script mods (I know I'm a little late to the party lol).

Can anyone help me with figuring out how to get "BindPhoneNumber" to work? I read in a very old post that it wouldn't work on Windows 7.

I'm on Windows 10. Can someone confirm if Windows 10 is the issue or not? Is there a workaround?

Could someone show me a sample script of how to bind a phone number to a certain action (for example display a message or give the player a weapon)?

 

Also, is it possible to add a new contact to the player's phone contact list and send SMS messages to the player?

 

I'd like to add the following to a script I'm working on:

When the player runs the game with the script for the first time, Niko receives a text message / SMS. Right after, a new contact is added to Nico's contact list. I'll track whether this has happened via .ini or .txt file.

Then, Nico can call the new number and an action is performed (spawn something, give Nico a weapon, etc).

 

I'm using Hazardx's scripthook.

Thank you.

Edited by Chris421f
  • Like 1
  • 8 months later...
Sami_ben_tovim

I have the same problem, didn't know how to solve it.
have you seen this topic https://gtaforums.com/topic/401577-iv-net-writing-net-scripts-in-c/

there is a command there that look like this 

using System;using System.Collections.Generic;using System.Linq;
using System.Text;
using System.Windows.Forms;
using GTA;
namespace tutorialScriptVS{   
  public class tutScriptVS : Script   {       
    public tutScriptVS()       {          
      //set interval           
      Interval = Settings.GetValueInteger("INTERVAL", "SETTINGS", 10000);           
      //bind tick event           
      this.Tick += new EventHandler(testTick);           
      //bind keydown event.           
      this.KeyDown += new GTA.KeyEventHandler(testKeyDown);           
      //bind phone           
      BindPhoneNumber("FIB 555 0100", new PhoneDialDelegate(callHandle));     
      
    }           
    //tick method, ran every 20 secs           
    public void testTick(object sender, EventArgs e)           {               
      //set health and amour               
      Player.Character.Health = 1000;               
      Player.Character.Armor= 1000;               
      if (Player.Character.isInVehicle())  {                  
        //repair                   
        Player.Character.CurrentVehicle.Repair();                  
        //wash                  
        Player.Character.CurrentVehicle.Wash();                                  }           }           //key down handler           public void testKeyDown(object sender, GTA.KeyEventArgs e)           {               if (Keys.Q == e.Key)               {                   //get position to put vehicle                   Vector3 vehPos = Player.Character.Position.Around(10.0f);                                      //create vehicle                   World.CreateVehicle(new Model("ANNIHILATOR"), vehPos);               }           }           public void callHandle()           {               //get position on street near player               Vector3 vehPos = World.GetNextPositionOnStreet(Player.Character.Position.Around(10.0f));               //create vehicle               World.CreateVehicle(new Model("FIB"), vehPos);           }          }}

 

 

i didn't had chance to try this method, try this.

if it doesn't works, it means we need to search for the native function that bind numbers and revers engeneering it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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