Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

OnPlayerChangeRadioStation

GtakillerIV edited this page Nov 15, 2014 · 2 revisions

OnPlayerChangeRadioStation

Gets called when a player's radio station changes


Parameters

playerid

The player's id.

stationid

The new radio's station id.

vehicleid

The ID of the vehicle that the player was in.

Usage

public OnPlayerChangeRadioStation(playerid, stationid, vehicleid)
{
    new string[128];

    switch(stationid)
    {
    	//If the player tuned into Playback FM
        case RADIO_PLAYBACKFM:
        {
            format(string, sizeof(string), "You're now listening to Playback FM(%d)", stationid);
        }
        //If the player tuned into K Rose
        case RADIO_KROSE:
        {
            format(string, sizeof(string), "You're now listening to K Rose FM(%d)", stationid);
        }
        //If the player tuned into K-DST
        case RADIO_KDST:
        {
            format(string, sizeof(string), "You're now listening to K-DST FM(%d)", stationid);
        }
        //Else
        default:
        {
            format(string, sizeof(string), "You're now listening to radio station id %d", stationid);
        }
    }

    SendClientMessage(playerid, -1, string);
}

See Also

GetPlayerRadioStation

SetRadioStationForPlayer

Clone this wiki locally