Playing sound with a weapon - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Playing sound with a weapon (
/showthread.php?tid=493546)
Playing sound with a weapon -
Tropicali - 08.02.2014
I'm wondering if there is a way to play sound when a weapon goes off.
So, for example; if I threw a grenade at say 3 people in a room, how would I make it so those 3 people the grenade was thrown at & damages hears a sound?
Thanks guys.
Re: Playing sound with a weapon -
WantedBot - 08.02.2014
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
return 1;
}
public OnPlayerGiveDamage(playerid,damagedid,Float:amount,weaponid)
{
PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
return 1;
}
Find more info here:
https://sampforum.blast.hk/showthread.php?tid=379416
Re: Playing sound with a weapon -
Tropicali - 16.02.2014
Got it. Worked out a way to calculate the damage of a grenade, you need to use the explosion ID rather than the grenade its self.