IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Post mod/code requests in the Mod Requests topic

Post mod releases in the Mod Showroom

Read the Modding Rules BEFORE posting!

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Is their a way?

 
FI_pr0t0typ3  
Posted: Sunday, Sep 23 2012, 03:56
Quote Post


Crackhead
Group Icon
Group: Members
Joined: Sep 7, 2012

us.gif

XXXXX



Is their a way to create a marker (like at car wash,yellow arrow) and check if a player is in it with a car... aswell as doing something if he is in .cs (that scripthook reads in SCRIPTS folder)?If so can someone explain how?

If not i understand xD i just really need to know how for a mod im working on.
Users WebsitePMXbox Live
  Top
 

 
Grady Featherstone  
Posted: Monday, Sep 24 2012, 07:51
Quote Post


GTAPoliceMods.com Web Developer
Group Icon
Group: Members
Joined: Jan 4, 2012

au.gif

XXXXX



So you want a yellow marker to appear at a car wash if the player is at it in a car?
Users WebsitePM
  Top
 

 
FI_pr0t0typ3  
Posted: Monday, Sep 24 2012, 18:00
Quote Post


Crackhead
Group Icon
Group: Members
Joined: Sep 7, 2012

us.gif

XXXXX



No,i mean like putting a little yellow marker at specific coordinates.Then when a car enters the marker a specific function (which ive already made) occurs.
Users WebsitePMXbox Live
  Top
 

 
Grady Featherstone  
Posted: Monday, Sep 24 2012, 23:02
Quote Post


GTAPoliceMods.com Web Developer
Group Icon
Group: Members
Joined: Jan 4, 2012

au.gif

XXXXX



Sure, see if this will work, put the following in your constructor:

CODE
Blip yourAwesomeBlip;
Vector3 locationForBlipToAppear = new Vector3(x, y, z);
bool addedBlip = false;
bool startedYourFunction = false;


Where it says "x, y, z" you need to enter the x, y and z coordinates that you want the marker to appear at! This is also the position that the player will go to to start your specific function!!!
Next, put this in a tick function:

CODE
if(addedBlip == false)
{
       yourAwesomeBlip = Blip.AddBlip(locationForBlipToAppear);
       yourAwesomeBlip.Icon = BlipIcon.Destination;
       yourAwesomeBlip.Display = BlipDisplay.ArrowAndMap;
       addedBlip = true;
}
if(Player.Character.Position.DistanceTo(locationForBlipToAppear) < 1.0f && addedBlip == true && startedYourFunction == false && Player.Character.IsInVehicle())
{
       yourFunction();
       startedYourFunction = true;
}


OK, so what that does, is it checks if you've already added the blip, if not, then it adds the blip, and sets the "addedBlip" variable to true. This is so that the game doesn't continue adding the blip forever!!!
Then, the game checks if the player is 1.0 units (or whatever the game measurement is) away from your blip's position. But it only checks that if the blip has been added, and your "startedYourFunction" variable is false. If so, then it starts your function, and sets that variable to true, once again, so that while the player is standing there, the game doesn't try and run your function over and over and over!!!
It also checks to see if the player is in a vehicle, and will only run if he or she is, but you can remove the "&& Player.Character.IsInVehicle()" if you want them to be able to trigger the function on foot as well!!!
This is written in C# by the way, sorry, forgot to ask that, but I assumed so as you want it in a .cs file in the "scripts" folder!!!!!!
I hope that this has helped you! If not, just reply back!!!
biggrin.gif

This post has been edited by Grady Featherstone on Monday, Sep 24 2012, 23:08
Users WebsitePM
  Top
 

 
Prof_Farnsworth  
Posted: Tuesday, Sep 25 2012, 14:26
Quote Post


Ambient Modder
Group Icon
Group: Members
Joined: Feb 25, 2011

XXXXX



QUOTE (Grady Featherstone @ Monday, Sep 24 2012, 23:02)
Sure, see if this will work, put the following in your constructor:

CODE
Blip yourAwesomeBlip;
Vector3 locationForBlipToAppear = new Vector3(x, y, z);
bool addedBlip = false;
bool startedYourFunction = false;


Where it says "x, y, z" you need to enter the x, y and z coordinates that you want the marker to appear at! This is also the position that the player will go to to start your specific function!!!
Next, put this in a tick function:

CODE
if(addedBlip == false)
{
       yourAwesomeBlip = Blip.AddBlip(locationForBlipToAppear);
       yourAwesomeBlip.Icon = BlipIcon.Destination;
       yourAwesomeBlip.Display = BlipDisplay.ArrowAndMap;
       addedBlip = true;
}
if(Player.Character.Position.DistanceTo(locationForBlipToAppear) < 1.0f && addedBlip == true && startedYourFunction == false && Player.Character.IsInVehicle())
{
       yourFunction();
       startedYourFunction = true;
}


OK, so what that does, is it checks if you've already added the blip, if not, then it adds the blip, and sets the "addedBlip" variable to true. This is so that the game doesn't continue adding the blip forever!!!
Then, the game checks if the player is 1.0 units (or whatever the game measurement is) away from your blip's position. But it only checks that if the blip has been added, and your "startedYourFunction" variable is false. If so, then it starts your function, and sets that variable to true, once again, so that while the player is standing there, the game doesn't try and run your function over and over and over!!!
It also checks to see if the player is in a vehicle, and will only run if he or she is, but you can remove the "&& Player.Character.IsInVehicle()" if you want them to be able to trigger the function on foot as well!!!
This is written in C# by the way, sorry, forgot to ask that, but I assumed so as you want it in a .cs file in the "scripts" folder!!!!!!
I hope that this has helped you! If not, just reply back!!!
biggrin.gif

This will create the blip, but after trying it, does not create the arrow marker.

Grady Featherstone's code will work. However, instead of adding a blip, do this:

1) Create an object at the location (I use "amb_apple" because it is small).

World.CreateObject(params);

2) Set objects visibility and collision false.

object_name.Visibility = false;
object_name.Collision = false;

3) Attach a blip to the object.

Blip blip_name = object_name.AttachBlip();

Then use blip_name.params" to change the attributes.
PM
  Top
 

 
Grady Featherstone  
Posted: Tuesday, Sep 25 2012, 22:55
Quote Post


GTAPoliceMods.com Web Developer
Group Icon
Group: Members
Joined: Jan 4, 2012

au.gif

XXXXX



QUOTE (Prof_Farnsworth @ Wednesday, Sep 26 2012, 00:26)
QUOTE (Grady Featherstone @ Monday, Sep 24 2012, 23:02)
Sure, see if this will work, put the following in your constructor:

CODE
Blip yourAwesomeBlip;
Vector3 locationForBlipToAppear = new Vector3(x, y, z);
bool addedBlip = false;
bool startedYourFunction = false;


Where it says "x, y, z" you need to enter the x, y and z coordinates that you want the marker to appear at! This is also the position that the player will go to to start your specific function!!!
Next, put this in a tick function:

CODE
if(addedBlip == false)
{
       yourAwesomeBlip = Blip.AddBlip(locationForBlipToAppear);
       yourAwesomeBlip.Icon = BlipIcon.Destination;
       yourAwesomeBlip.Display = BlipDisplay.ArrowAndMap;
       addedBlip = true;
}
if(Player.Character.Position.DistanceTo(locationForBlipToAppear) < 1.0f && addedBlip == true && startedYourFunction == false && Player.Character.IsInVehicle())
{
       yourFunction();
       startedYourFunction = true;
}


OK, so what that does, is it checks if you've already added the blip, if not, then it adds the blip, and sets the "addedBlip" variable to true. This is so that the game doesn't continue adding the blip forever!!!
Then, the game checks if the player is 1.0 units (or whatever the game measurement is) away from your blip's position. But it only checks that if the blip has been added, and your "startedYourFunction" variable is false. If so, then it starts your function, and sets that variable to true, once again, so that while the player is standing there, the game doesn't try and run your function over and over and over!!!
It also checks to see if the player is in a vehicle, and will only run if he or she is, but you can remove the "&& Player.Character.IsInVehicle()" if you want them to be able to trigger the function on foot as well!!!
This is written in C# by the way, sorry, forgot to ask that, but I assumed so as you want it in a .cs file in the "scripts" folder!!!!!!
I hope that this has helped you! If not, just reply back!!!
biggrin.gif

This will create the blip, but after trying it, does not create the arrow marker.

Grady Featherstone's code will work. However, instead of adding a blip, do this:

1) Create an object at the location (I use "amb_apple" because it is small).

World.CreateObject(params);

2) Set objects visibility and collision false.

object_name.Visibility = false;
object_name.Collision = false;

3) Attach a blip to the object.

Blip blip_name = object_name.AttachBlip();

Then use blip_name.params" to change the attributes.

Ahhh yes, I've thought about that, as I haven't been able to get the marker with other things that I've done, I just assumed it was me rather than the code!!! Interesting to know!!!
Users WebsitePM
  Top
 

 

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG