|
 |
|
|
|
|
|
GTA Modification Forums
Is their a way?
 |
|
 |
| |
Grady Featherstone  |
|
GTAPoliceMods.com Web Developer

Group: Members
Joined: Jan 4, 2012


|
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!!! This post has been edited by Grady Featherstone on Monday, Sep 24 2012, 23:08
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Prof_Farnsworth  |
Posted: Tuesday, Sep 25 2012, 14:26
|
Ambient Modder

Group: Members
Joined: Feb 25, 2011

|
| 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!!!
|
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.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Grady Featherstone  |
Posted: Tuesday, Sep 25 2012, 22:55
|
GTAPoliceMods.com Web Developer

Group: Members
Joined: Jan 4, 2012


|
| 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!!!
|
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!!!
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|