:
Destination Time
:
Present Time
:
Last Time Departed
Sign in to follow this  
daangelo29

Getting the ID of the nearest car

Recommended Posts

I might have asked this before, but no one answered. Can't ask it in GTAForums because I asked it before but I never got an answer for it either.

Is it possible to get the ID of the nearest car then be able to spawn it using that ID? This is for my Transformers mod. At the moment, I'm still using a menu of personally-chosen cars for the conversions, but I want it like in the Transformer movies -- approach the device, scan it, copy it and transform to it on the spot -- if it is possible, that is.

Share this post


Link to post
Share on other sites

That code does makes a reference to the car, but I'll also need the vehicle's model number as well to be able to spawn it, unless you can spawn it using the one stored in the variable. (tried it myself; SA just end up crashing)

Share this post


Link to post
Share on other sites

:o

EXACTLY the code I was looking for. Thanks Blue. :D

Is it possible to do use while driving a car, or will I end up getting the model number of the very vehicle I was driving?

Share this post


Link to post
Share on other sites

Ok, getting the nearest didn't work. I just end up spawning the vehicle I'm model. The idea is that get the model of the nearest car, ignoring the car you're riding, then spawn that vehicle over the vehicle you're driving. I guess I'm back at the car menu...that's unless there's a code that allows me to aim at a certain vehicle and get the model ID/number of it.

Share this post


Link to post
Share on other sites

Speaking of which, I think I just found out what the problem of my Morpher Mod is...I used the wrong check/condition code.

Forgot about the code to check if the player model loaded is the default or not, I put in "not Actor.Model($PLAYER_ACTOR) == 0" at the moment while I'm doing the rest of the code. Forgot to change it to the appropriate one, but I completely forgot the code so I don't know

Am I using the wrong code, or does my mod have a different problem that I missed?

Share this post


Link to post
Share on other sites

lol, I was expecting for an answer like "No, it's $PLAYER_CHAR", but thanks anyway. I'm still a bit confused about the difference between $PLAYER_CHAR and $PLAYER_ACTOR.

I might not be able to release the Morpher Mod beta soon. Still have other stuff to do.

Share this post


Link to post
Share on other sites

Player_Char is of type Char

Player_Actor is of type Actor

The char is just the player in a metaphysical sense

The actor is the physical sense.

Like a movie. A character is just something on paper that has directions on what to do, but has no physical sense until an actor acts it out.

Share this post


Link to post
Share on other sites

Oh ok.

I remember having a conflict in the code I was working on before when I used the $PLAYER_ACTOR in an actor-based opcode, and I had to replace it with $PLAYER_CHAR to fix it, so that's how I got confused. Can't remember which opcode, though, but I think I understand now.

Share this post


Link to post
Share on other sites

then it probably has the wrong name. Remember all the names aren't exactly the right ones. I remember in bartons builder, cosine and sine were switched around, and that gets confusing.

Share this post


Link to post
Share on other sites

I am inspired with with angeloelibz's idea so I thought I wanna make one code like you for my KITT in GTA SA. I turned out to be really great. I just press one button and it copies the car in front of me. If there no cars in front of me, it won't change. But it doesn't copy peds.

Share this post


Link to post
Share on other sites

Watch this.... :lol:

I've some codes for KITT. I've also made a code for KITT to transform to the nearest car. It 's awesome. I have to thank you both. :D

Share this post


Link to post
Share on other sites

LOL it would be best though if it is the Knight 3000, plus this feature, plus a menu of transformable vehicles so the player also has the option to choose. I'll be using the same code for the Morpher Mod.

I remember in bartons builder, cosine and sine were switched around, and that gets confusing.

lol this might be the reason why the very first SCM mod (Super-Seesaw mod) never worked, even though I double-checked the code 21 f*cking times. It was going to be a cool SCM version of the C++ project I was working on (Ragdoll Seesaw), until I figured it began screwing up. I used sine and cosine in the code. Too bad I no longer have the code to try and work on it again. -_-

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.

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.

Loading...
Sign in to follow this