[HELP] PlayerPlaySound
#1

Hello, I'm just thinking of making a /playsound command that will start a track from GTA SA like this:

Код:
if (strcmp(cmd, "/startsong", true) == 0)
	{
	  if(PlayerInfo[playerid][pAdmin] >= 1337)
	  {
			GetPlayerName(playerid, sendername, sizeof(sendername));
	    format(string, sizeof(string), "AdmCmd: %s started a random song.",sendername);
      SendClientMessageToAll(COLOR_ADMINCHAT, string);
			PlayerPlaySound(playerid, 1187, 0.0, 0.0, 0.0);
	    return 1;
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREY, "  You are not authorized to use that command.");
			return 1;
		}
	}
This is not tested on other players yet, will this play the track to all players, if not, is it possible to make it play for all players on the server?

NOTE: I got a /stopsong with the ID 1188.

Thanks
Reply
#2

pawn Код:
PlaySoundForAll(soundid, Float:x, Float:y, Float:z)
{
    for (new i=0; i<MAX_PLAYERS; i++)
    {
      if (IsPlayerConnected(i))
      {
          PlayerPlaySound(i, soundid, x, y, z);
      }
    }
}
pawn Код:
PlaySoundForAll(1185, 0.0, 0.0, 0.0);//soundID, x, y, z
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)