Log in to reply
 

[Tutorial] Custom Notification Icon 'No Replace' C#/SHVDN3



  • Hello everyone,
    Here is a quick tutorial on "How to add and use custom notification icon" in C# / SHVDN3
    Without any original games files replacement ! You also could use the first part of the tutorial & use a different notifications way with custom icons
    So to start, you will need OpenIV, and a picture in size 64x64 (Pixels) in .dds type
    You could use any software to create this picture or download it & convert.
    I'm using GIMP, which allow exporting/converting in .dds (& is free !)

    Preview
    Each notifications have 3 fields,

    • Subject, Who or what send the message (Here = City Car Shop)
    • Object, what type of message or what message is about (Here = Information : )
    • Message, obviously what it says ! (Here = Welcome to the Shop)

    When you have your picture (in .dds), you will have to put it in game file.
    Here the picture will be call "Icon01"
    Open OpenIV & allow edit
    Go to mods/x64b.rpf/data/cdimages/scaleform_generic.rpf (If needed dump original files to mods folder)
    Then open New (Top left), & click textures dictionary (.ytd)
    Enter the texture dictionary name you wants, here we will take "TextureDict01", then click OK
    Now, find it & open it.
    Then import your pictures (Top left) in .dds format
    & then SAVE !

    Now the most interesting part, the code !
    Create a Method in ModName : Scripts

    void notifyAboveMap(string msgtype, string msg)
            {
                Function.Call(Hash.BEGIN_TEXT_COMMAND_THEFEED_POST, "STRING");
                Function.Call(Hash.ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME, msg);
                Function.Call(Hash.REQUEST_​STREAMED_​TEXTURE_​DICT, "TextureDict01", true); //Here you put the texture dictionary name you choose before
                Function.Call(Hash.END_​TEXT_​COMMAND_​THEFEED_​POST_​MESSAGETEXT, "TextureDict01", "Icon01", false, 1, "Turf Weapons & Armor Stock", msgtype); //the 5th argument here is Subject/Biggest top title, see picture
            }
    

    Now we have our method, lets call it in your scripts,

    notifyAboveMap("~g~Information ~w~:, "~b~Welcome ~y~to ~w~the ~g~Shop") // here you put Object first & Message then
    

    Then it should work ! If not fell free to ask ! If anyone need help it will be a pleasure for me,
    Also if anyone have any suggestion/modifications/improvements to make the code better i'm open minded ;)
    I really hope it will help someone, has it took me 1 week to fully understand and find how to :P
    See you & have fun !


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.