From 87d05982ee5b56eda6cbcb6c7011627b9fe968dd Mon Sep 17 00:00:00 2001 From: sahailee Date: Sun, 15 Nov 2020 01:53:50 -0500 Subject: [PATCH] Mute in game ads on the radio. --- radio.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/radio.cs b/radio.cs index fb0647e..6610ecc 100644 --- a/radio.cs +++ b/radio.cs @@ -251,12 +251,17 @@ private void displaySpotifyTrackOnRadio(string artist, string track) } - public string getCurrentStationName() + private string getCurrentStationName() { var name = Function.Call(GTA.Native.Hash.GET_PLAYER_RADIO_STATION_NAME); return name; } + private void disableRadioAds() + { + Function.Call(GTA.Native.Hash.SET_RADIO_STATION_MUSIC_ONLY, radioName, true); + } + private void setEngine(bool status) { if(obtainedSpotifyClient) @@ -603,6 +608,7 @@ private void LoginToSpotInit() { GuaranteeLogin(); initialSpotifyRequests(); + disableRadioAds(); } private async void initialSpotifyRequests()