PlayerPlaySound
#1

how to give a range in PlayerPlaySound(playerid, 1130, 0.0, 0.0, 10.0);

like this PlayerPlaySound(playerid, 1130, 0.0, 0.0, 10.0,range);
Reply
#2

Make a loop, check if any player is withing a certain range of the coordinates used in PlayerPlaySound and then play the sound for the player.
Reply
#3

with a timers?? and IsPlayerInRangeOfPoint ??
Reply
#4

Yes, that way.
Reply
#5

Код:
dcmd_startsongforall(playerid, params[])
{
	for(new b; b<GetMaxPlayers(); b++) if(IsPlayerInRangeOfPoint(b,50.0,-703.0861,963.7906,12.4002))
	{
		for(new a; a<GetMaxPlayers(); a++) PlayerPlaySound(a, 1057, 0.0, 0.0, 0.0);
		}
	return 1;
}
dont work <.<
Reply
#6

pawn Код:
stock PlaySoundEx(soundid,Float:x,Float:y,Float:z,Float:range)
{
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i,range,x,y,z))
{
PlayerPlaySound(i,soundid,0,0,0);
}
}
}
}
Not tested
Reply
#7

look at new topic i try the code
Reply
#8

dont work ... i have to set a timer?
Reply
#9

Quote:
Originally Posted by [ZDM
jumbo ]
dont work ... i have to set a timer?
Код:
forward CheckPlaySoundEx(soundid,Float:x,Float:y,Float:z,Float:range);
public CheckPlaySoundEx(soundid,Float:x,Float:y,Float:z,Float:range)
{
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i,range,x,y,z))
{
PlayerPlaySound(i,soundid,0,0,0);
}
}
}
}
now on init type:

SetTimerEx(CheckPlaySoundEx,50,1,"i",soundid,Float ,Float:y,Float:z,Float:range);
Reply
#10

Quote:
Originally Posted by DaneAMattie
Quote:
Originally Posted by [ZDM
jumbo ]
dont work ... i have to set a timer?
Код:
forward CheckPlaySoundEx(soundid,Float:x,Float:y,Float:z,Float:range);
public CheckPlaySoundEx(soundid,Float:x,Float:y,Float:z,Float:range)
{
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i,range,x,y,z))
{
PlayerPlaySound(i,soundid,0,0,0);
}
}
}
}
now on OnGamemodeInit type:

SetTimerEx(CheckPlaySoundEx,50,1,"i",soundid,Float ,Float:y,Float:z,Float:range);
u probly replace Float etc with ur value's

btw Not Tested
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)