SA-MP Forums Archive
PlayerPlaySound To all Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PlayerPlaySound To all Help (/showthread.php?tid=490613)



PlayerPlaySound To all Help - alishvasis - 27.01.2014

How To PlayerPlaySound To all ? Pls Help Me

This Code Play Sound For 1 player
Код:
PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
Help Me TnX


Re: PlayerPlaySound To all Help - Ranshand - 27.01.2014

Try with this.
Код:
stock PlaySoundForAll(SoundId,Float:X,Float:Y,Float:Z)
{
	for(new Slots = GetMaxPlayers(), P; P < Slots; P++)
	{
		if(IsPlayerConnected(P))
		{
			PlayerPlaySound(P,SoundId,X,Y,Z);
		}
	}
	return 1;
}



Re: PlayerPlaySound To all Help - alishvasis - 27.01.2014

Quote:
Originally Posted by Ranshand
Посмотреть сообщение
Try with this.
Код:
stock PlaySoundForAll(SoundId,Float:X,Float:Y,Float:Z)
{
	for(new Slots = GetMaxPlayers(), P; P < Slots; P++)
	{
		if(IsPlayerConnected(P))
		{
			PlayerPlaySound(P,SoundId,X,Y,Z);
		}
	}
	return 1;
}
No I Put This Not For Player Conect ! At This Code :
Код:
    if(GetVehicleModel(vehicleid) == 428 && ispassenger == 0)
    {
			HarvestJob[playerid] = 1;
            new name[MAX_PLAYER_NAME], string[200];
    		GetPlayerName(playerid, name, sizeof(name));
			format(string, sizeof(string), "{FF0000}[Dozdi] {FFFF00}MAshine BAnk {FF0000}Dozdide {FFFFFF}Shod {FF0000}Darhale  {FFFF00}Dozdidan ast! Bazikon : {FF0000}%s", name);
			SendClientMessageToAll(COLOR_WHITE, string);
            SetPlayerCheckpoint(playerid,-2806.4221,843.8745,45.0281,10);
            SendClientMessage(playerid,COLOR_RED,"{FF0000}[Dozdi]] {FFFF00}Police Ha DAr Kamin Hastand!");
            PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0); <<<<<<<<<<<<<<<<<<<
            SetPlayerWantedLevel(playerid, 6);
        }
}
I Fixed Itttt__________________________________________