Small question
#1

Hey I wanna define songs Like if I do /radio 1 that 1 = song called Dare mama from tupac,
how to define liek this code :

Код:
CMD:tupacmary(playerid, params[])
{
    new string[128];
    if(playerVariables[playerid][pAdminLevel] >= 3)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            PlayAudioStreamForPlayer(i, "http://www.symphonyofnoise.com/binv2/ListenRap/06.Tupac-HailMairy.mp3");
        }
        GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "Music Admin: %s has started the Song Tupac - Hail mary", szPlayerName);
        SendClientMessageToAll(COLOR_LIGHTRED, string);
    }

    return 1;
}
Just that this song is #1,

So it's better to do like /playglobal songid
Reply
#2

Код:
CMD:radio(playerid, params[])
{
    new string[128], url[126];
    new id = strval(params[0]);
    if(playerVariables[playerid][pAdminLevel] >= 3)
    {
        switch(id) {
			case 1: format(url, sizeof(url), "http://www.symphonyofnoise.com/binv2/ListenRap/06.Tupac-HailMairy.mp3");
			default: return 1;
        }
		
		for(new i = 0; i < MAX_PLAYERS; i++) {
			PlayAudioStreamForPlayer(i, url);
		}

        GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "Music Admin: %s has started the Song Tupac - Hail mary", szPlayerName);
        SendClientMessageToAll(COLOR_LIGHTRED, string);
    }
    return 1;
}
Try this.

You may also want to make it so that if someone just types /radio in, or an invalid radio number, it shows a list of the songs.
Reply
#3

Thanks the code works but how do I do that the song name changes every other case ?
Reply
#4

24 hours passed,

But it's just i want when I'll do /radio 1 that it is saying Playing song "songname"
/radio 2 "playing song songname2"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)