Quantcast

Jump to content

» «
Photo

Check if player is near ATM

8 replies to this topic
Wiebrendh
  • Wiebrendh

    C# Programmer

  • Members
  • Joined: 22 Mar 2014
  • Netherlands

#1

Posted 07 August 2014 - 05:32 PM

Hey, how do i check if the player is near a ATM?


LetsPlayOrDy
  • LetsPlayOrDy

    Lets mod or die!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#2

Posted 07 August 2014 - 05:37 PM

I believe you would have to get all of the positions of every ATM machine, then just check if the distance from you to any of them is within a certain distance.

Wiebrendh
  • Wiebrendh

    C# Programmer

  • Members
  • Joined: 22 Mar 2014
  • Netherlands

#3

Posted 07 August 2014 - 07:02 PM

I believe you would have to get all of the positions of every ATM machine, then just check if the distance from you to any of them is within a certain distance.

 

Oh, oke, there is no way to check if the player is close to an the model of the atm?


LetsPlayOrDy
  • LetsPlayOrDy

    Lets mod or die!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#4

Posted 07 August 2014 - 07:08 PM

 

I believe you would have to get all of the positions of every ATM machine, then just check if the distance from you to any of them is within a certain distance.

 

Oh, oke, there is no way to check if the player is close to an the model of the atm?

 

No, unless each ATM is an object, which I wouldn't think they would be, but I could be mistaken. If they are objects, just use something like this (only ATM model I could find)

GTA.Object[] atms = World.GetAllObjects("CJ_NEW_ATM")

If they aren't, you'll have to map out each manually.


Wiebrendh
  • Wiebrendh

    C# Programmer

  • Members
  • Joined: 22 Mar 2014
  • Netherlands

#5

Posted 07 August 2014 - 08:02 PM Edited by Wiebrendh, 07 August 2014 - 08:06 PM.

 

 

I believe you would have to get all of the positions of every ATM machine, then just check if the distance from you to any of them is within a certain distance.

 

Oh, oke, there is no way to check if the player is close to an the model of the atm?

 

No, unless each ATM is an object, which I wouldn't think they would be, but I could be mistaken. If they are objects, just use something like this (only ATM model I could find)

GTA.Object[] atms = World.GetAllObjects("CJ_NEW_ATM")

If they aren't, you'll have to map out each manually.

 

 

I hope there is :) That would save me some time haha

Found all the locations at least: http://www.grandthef..._Teller_Machine

  • LetsPlayOrDy likes this

InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#6

Posted 07 August 2014 - 08:44 PM Edited by InfamousSabre, 07 August 2014 - 08:54 PM.

Check out this mod and see how AngryAmoeba did it.
http://www.gta4-mods...d-101313-f10259

He seems to look for Objects with model GB_cashmachine01 and/or GB_cashmachine02, but also has a list of coordinates in case the model hasn't been spawned yet.

Looks like LPOD responded before I could finish my edit :p

  • LetsPlayOrDy and Wiebrendh like this

LetsPlayOrDy
  • LetsPlayOrDy

    Lets mod or die!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#7

Posted 07 August 2014 - 08:51 PM Edited by LetsPlayOrDy, 07 August 2014 - 08:51 PM.

Check out this mod and see how AngryAmoeba did it.
http://www.gta4-mods...d-101313-f10259

Thank you for that.

Here is what I have found from it:

It uses objects and their models to detect the ATMs and then their positions.

The object models it used were:

  • GB_cashmachine01
  • GB_cashmachine02
  • Wiebrendh likes this

Wiebrendh
  • Wiebrendh

    C# Programmer

  • Members
  • Joined: 22 Mar 2014
  • Netherlands

#8

Posted 07 August 2014 - 08:54 PM

Thanks!


LetsPlayOrDy
  • LetsPlayOrDy

    Lets mod or die!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#9

Posted 07 August 2014 - 08:55 PM

Looks like LPOD responded before I could finish my edit :p

I'm too fast for ya :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users