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

    1. GTA Online

      1. The Diamond Casino Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

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

      1. Recruitment
      2. Events
    1. Red Dead Redemption 2

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

    1. Grand Theft Auto Series

    2. GTA 6

    3. GTA V

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

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

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

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

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

    3. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    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
    3. Gangs

    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  

[C#] detect mod being refreshed and remove blips

Recommended Posts


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

Take a look at this thread:




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

1.Download scripthookVdotnet source.

2.Add event in unload method


4. (Maybe) PROFIT!!!

It should work.


All the best,


Share this post

Link to post
Share on other sites

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

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

Override Dispose method:

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

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.

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  

  • 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.