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 IV 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 SA Mods
    10. GTA Vice City

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

      1. Guides & Strategies
      2. Help & Support
      3. GTA III 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

Sign in to follow this  
SYNTHES1SE

[C#] detect mod being refreshed and remove blips

Recommended Posts

SYNTHES1SE

I'm looking for a way to detect that my mod is being refreshed, so i can remove any blips I've added to the map. As it stands, every time a user refreshes ScriptHookV, my blips are added again and after a session of testing, i can have upwards of 100 blips on my map,

 

It doesnt really seem to be a performace issue for me, but on lesser PC's i fear it may be, And i dont like having duplicate blips.

 

I guess most users arent gonna be refreshing ScriptHookV much, but im sure some will be, and i'd like to cover that situation. Ive looked at.

 

Ive found

void REMOVE_BLIP(int *blip) // 86A652570E5F25DD D8C3C1CD

but passing the blip, the blip handle, or the blip hashcode does not work, but even if it did, i need some sort of modRefreshed() event to use it in.

 

Sorry for the wall of text.

 

TL;DR: How can i detect if my mod is about to be unloaded, and how can i remove blips?

Share this post


Link to post
Share on other sites
frodzet

Take a look at this thread:

 

https://github.com/crosire/scripthookvdotnet/issues/218

 

There's a guy having a similar issue.

 

Haven't checked if the issue is fixed, however they added an enhancement label to the topic, which means that it probably is something that will be changed in the near future.

Edited by frodzet

Share this post


Link to post
Share on other sites
leftas

1.Download scripthookVdotnet source.

2.Add event in unload method

3.????

4. (Maybe) PROFIT!!!

It should work.

 

All the best,

Paul.

Share this post


Link to post
Share on other sites
Enumerator

Blips start from (0>GET_NUMBER_OF_ACTIVE_BLIPS)

You should store the blip count + 1 as your created blip and then use that number to remove the blip.

Edited by Enumerator

Share this post


Link to post
Share on other sites
Jitnaught

You could either store the IDs of the blips in a file, and then when your mod starts check if those exist and are the correct blip type, and then delete them, or what leftas said.

Share this post


Link to post
Share on other sites
Inco

Override Dispose method:

protected override void Dispose( bool A_0 ){    if ( A_0 )    {        // remove your blips here    }}

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.
Note: Your post will require moderator approval before it will be visible.

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.

Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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