17.02.2012, 12:11
pawn Code:
CMD:youaremyno1(playerid, params[])
{
new string[128],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if(IsSongPlaying[playerid] == 0)
{
format(string, sizeof(string), "%s has played the song You're my number one by S CLUB 7", pname);
SendClientMessageToAll(COLOR_RED, string);
SendClientMessage(playerid, COLOR_GREEN, "You played the song You're my number one by S CLUB 7");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (i != playerid))
{
PlayAudioStreamForPlayer(i, "http://k002.kiwi6.com/hotlink/04gp2006f8/s_club_7_you_re_my_number_one.mp3");
IsSongPlaying[i] = 1;
}
}
}
else
{
format(string, sizeof(string), "%s has stop playing the song You're my number one by S CLUB 7", pname);
SendClientMessageToAll(COLOR_RED, string);
SendClientMessage(playerid, COLOR_RED, "You stop playing the song You're my number one by S CLUB 7");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (i != playerid))
{
StopAudioStreamForPlayer(i);
IsSongPlaying[i] = 0;
}
}
}
return 1;
}

