Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

FutureNesky

How to use this function?

Recommended Posts

FutureNesky

Hello, I wonder how I use this function: UI::IS_ENTITY_IN_AREA

 

Every time I try using it, it crashes. And I do not find any explanation on how to use it so if you know how tell me please! Thanks!

Share this post


Link to post
Share on other sites
Guest

Show us the code you have used and it will give us a better idea of what is going wrong. For instance, this is how it is shown on NativeDB:

 

BOOL IS_ENTITY_IN_AREA(Entity entity, float x1, float y1, float z1, float x2, float y2, float z2, BOOL p7, BOOL p8, Any p9)

 

What are you trying to get back from that function? How are you passing the parameters to it? What language are you using etc...?

Share this post


Link to post
Share on other sites
FutureNesky

Actually, the function worked. I just forgot to put WAIT(0) in my while loop. 

Thanks for your time and help. Really appreciated :)

void main()
{
	ui_add_blip(5.07, -706.86, 45.97, 408);

	while (true)
	{
		if (ENTITY::IS_ENTITY_IN_AREA(PLAYER::PLAYER_PED_ID(), 1.02, -716.04, 45.97, 13.02, -702.10, 45.97, false, false, false))
		{
			ui_add_help();
		}

		WAIT(0);
	}
}

 

Edited by FutureNesky

Share this post


Link to post
Share on other sites
Guest

I write in C# but from what I can see from the examples used in the scripts, the first 6 parameters define a box. The first 3 parameters seem to be the lower left corner, the next 3 seem to be the upper right. Both of your Z parameters, 3 and 6 are the same, so the box has no height. Look at this example from the scripts.

if (!entity::is_entity_in_area(player::player_ped_id(), 927f, -2080f, -10f, 1141f, -1858f, 50f, 0, 1, 0)

You can see parameter 3 is -10f and parameter 6 is 50f, so the box has a 60f height. The last three parameters seem to be 0, 1, 0 or false, true, false most of the time.

 

Other than those area parameters being the same, I can't see what would cause a crash, however, I have zero experience in C++, sorry.

Share this post


Link to post
Share on other sites
Guest

It definitely seems to work as I thought. This quick test mod created a an area ahead of the player that's about 6f x 6f x 5f and as you walk in and out of the area, the message changes. That's using the 0, 1, 0 for the final 3 parameters as well.

 

So if you get the parameters right and still have a crash, then maybe it's something else in the rest of the mod that is causing the problem... sorry I can't help more than that.

 

sHl1vFG.jpg

Edited by Guest

Share this post


Link to post
Share on other sites
FutureNesky
5 minutes ago, LeeC2202 said:

It definitely seems to work as I thought. This quick test mod created a an area ahead of the player that's about 6f x 6f x 5f and as you walk in and out of the area, the message changes. That's using the 0, 1, 0 for the final 3 parameters as well.

 

So if you get the parameters right and still have a crash, then maybe it's something else in the rest of the mod that is causing the problem... sorry I can't help more than that.

 

sHl1vFG.jpg

Thanks for the help mate! You're really cool. It worked for me. Thanks!

 

Do you know how I can make something like this? Do you know the function?

 

https://imgur.com/a3lwaGS

Edited by FutureNesky

Share this post


Link to post
Share on other sites
Guest

That's the DrawMarker (DRAW_MARKER as a Native name) function and that's the VerticalCylinder marker type.

Edited by Guest

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.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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