PlayerPlaySound Issue [SOLVED]
#1

Hi, I am trying to create a simple car alarm system which sounds 50% of the time when a players state changes to driver.

When the alarm sounds it is only heard by the person that entered the vehicle, I actually want all nearby players to hear it also. I know my code should only work for the individual player, I just want to know what should be added to make it work as desired.

Here is the code:

Код:
public CarAlarmTimer()
{
  for(new i=0; i<MAX_PLAYERS; i++) {
		if (IsPlayerConnected(i) && AlarmSounded[i] <= 9) {
		  AlarmSounded[i] += 1;
		  if (AlarmSounded[i] <= 9) {
		  	new currentveh;
     		currentveh = GetPlayerVehicleID(i);
     		new Float:vehx, Float:vehy, Float:vehz;
     		GetVehiclePos(currentveh, vehx, vehy, vehz);
    		PlayerPlaySound(i, 1147, vehx, vehy, vehz);
    	} else {
    		KillTimer(CarAlarm);
    		AlarmSounded[i] = 10;
			}
		}
	}
}
Any help or suggestions are welcome, thanks.
Reply


Messages In This Thread
PlayerPlaySound Issue [SOLVED] - by Infamous - 24.05.2010, 23:05
Re: PlayerPlaySound Issue - by Backwardsman97 - 25.05.2010, 02:30
Re: PlayerPlaySound Issue [SOLVED] - by Infamous - 25.05.2010, 10:02

Forum Jump:


Users browsing this thread: 1 Guest(s)